Skip to content DS OneLink Component | DS one
DS one

Link Component

The ds-link component provides navigation links with built-in support for internal routing and scroll position preservation.

<ds-link href="/about">About</ds-link>
<ds-link href="https://example.com">External Link</ds-link>

Internal links automatically preserve scroll position when navigating:

<ds-link href="/products" internal>View Products</ds-link>
AttributeTypeDefaultDescription
hrefstring-URL to navigate to
internalbooleanfalseWhether this is an internal link (enables scroll preservation)
targetstring-Link target (_blank, _self, etc.)

DS One automatically preserves scroll position when navigating between pages using internal links. This provides a better user experience when users navigate back.

<!-- Scroll position is preserved -->
<ds-link href="/page1" internal>Page 1</ds-link>
<ds-link href="/page2" internal>Page 2</ds-link>
<ds-link href="https://github.com/jo4712/ds-one" target="_blank">
View on GitHub
</ds-link>
<ds-link href="/documentation">
<ds-icon name="open"></ds-icon>
Documentation
</ds-link>