Typography
Link
Inline links with accent or neutral tone, external-link handling and router integration via asChild.
import { Link } from '@reactloom/ui';Examples
Links
import { Link, Stack, Text } from '@reactloom/ui';
export default function Example() {
return (
<Stack gap="2">
<Text>
Read the <Link href="#migration">migration guide</Link> before upgrading.
</Text>
<Text>
<Link href="#neutral" tone="neutral" underline="always">Neutral, always underlined</Link>
</Text>
<Text>
Check the <Link href="https://example.com" external>status page</Link>.
</Text>
</Stack>
);
}API reference
| Prop | Type | Default |
|---|---|---|
tone | 'accent' | 'neutral' | 'accent' |
underline | 'hover' | 'always' | 'none' | 'hover' |
externalNew tab, safe rel, icon and announced hint. | boolean | false |
externalLabel | string | '(opens in a new tab)' |
asChildStyle your router’s link. | boolean | false |
Customization
Extracted from the component’s source on every build, so it matches the code. How the layers fit together is explained in Customization.
State attributes
Target these in your CSS to style states without depending on class names.
| Attribute | Values |
|---|---|
[data-tone] | accent · neutral |
[data-underline] | always · hover · none |
Theme tokens it reads
--pl-color-fg-default --pl-color-fg-link --pl-focus-ring-color --pl-focus-ring-width --pl-radius-xs
Accessibility
- External links announce that they open a new tab.
- Use underline="always" for neutral links inside paragraphs (WCAG 1.4.1).
| Key | Action |
|---|---|
| Enter | Follow the link |
Usage guidelines
Do
- Write link text that makes sense out of context.
Don’t
- Don’t use “click here”.