tsimport {XDSLink} from '@xds/core/Link'
| Guidance | Practices |
|---|---|
| Do | Write descriptive, concise link text that clearly communicates the destination. |
| Do | Set `isStandalone` when the link appears outside of inline text, so it receives proper base font sizing. |
| Don't | Use Link for actions that do not navigate — use a Button instead. |
| Don't | Use generic text like "click here" or "read more" — describe the destination. |
| Don't | Use icon-only links without a visible text label. |
| Prop | Type | Description |
|---|---|---|
labelrequired | string | Accessible label |
childrenrequired | ReactNode | Link content |
as | XDSLinkComponentType | Custom component to render instead of <a> |
href | string | Link destination URL |
hasUnderline | boolean (default: false) | Always show underline |
isDisabled | boolean (default: false) | Disables the link |
isExternalLink | boolean (default: false) | Opens in new tab with external icon |
target | string | Where to open linked document |
onClick | MouseEventHandler | Click event handler |
tooltip | string | Tooltip text displayed on hover |
isStandalone | boolean (default: false) | Applies base font sizing |
tsx'use client';import {XDSLink} from '@xds/core/Link';import {XDSVStack} from '@xds/core/Layout';export default function LinkExternalLinks() {return (<XDSVStack gap={2}><XDSLinklabel="GitHub"href="https://github.com"isExternalLinkisStandalone>GitHub</XDSLink><XDSLinklabel="MDN Web Docs"href="https://developer.mozilla.org"isExternalLinkisStandalone>MDN Web Docs</XDSLink><XDSLinklabel="React Documentation"href="https://react.dev"isExternalLinkhasUnderlineisStandalone>React Documentation</XDSLink></XDSVStack>);}
tsx'use client';import {XDSLink} from '@xds/core/Link';import {XDSText} from '@xds/core/Text';export default function LinkInlineLink() {return (<XDSText type="body">Read the{' '}<XDSLink label="documentation" href="/docs">documentation</XDSLink>{' '}for more information about using XDS components.</XDSText>);}
tsx'use client';import {XDSLink} from '@xds/core/Link';import {XDSHStack} from '@xds/core/Layout';export default function LinksWithTooltips() {return (<XDSHStack gap={4} vAlign="center"><XDSLinklabel="Settings"href="/settings"tooltip="Configure your account settings"isStandalone>Settings</XDSLink><XDSLinklabel="Profile"href="/profile"tooltip="View and edit your profile"isStandalone>Profile</XDSLink><XDSLinklabel="Help"href="/help"tooltip="Get help and support"color="secondary"isStandalone>Help</XDSLink></XDSHStack>);}
tsx'use client';import {XDSLink} from '@xds/core/Link';export default function LinkShowcase() {return (<XDSLink label="Documentation" href="/docs" isStandalone>Documentation</XDSLink>);}