A link to a page
import { Link } from "@senvenli/react/action";
export default function Example() {
return <Link href="#">View all orders</Link>;
}import { Link } from "@senvenli/react/action";Examples
In running text
Always underlined, so it is found without relying on color.import { Link } from "@senvenli/react/action";
import { Text } from "@senvenli/react/display";
export default function Example() {
return (
<Text elementType="p">
By placing an order you agree to{" "}
<Link href="#" variant="inline">
the terms of service
</Link>{" "}
and{" "}
<Link href="#" variant="inline">
the privacy policy
</Link>
.
</Text>
);
}External
Opens in a new tab, shows the arrow and tells screen readers so.import { Link } from "@senvenli/react/action";
export default function Example() {
return (
<Link href="https://example.com/docs/shipping" isExternal>
Shipping documentation
</Link>
);
}Subtle
For footers and legal rows, where links should not compete with content.import { Link } from "@senvenli/react/action";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-200">
<Link href="#" variant="subtle">
Privacy policy
</Link>
<Link href="#" variant="subtle">
Terms of service
</Link>
<Link href="#" variant="subtle">
System status
</Link>
</Stack>
);
}Guidelines
When to use it
- Going to another page from within text or a footer.
Use something else when
- The link is a call to action that should look like a button. Button
Do and avoid
- Name the destination; never "click here".
Accessibility
Keyboard
| Keys | What happens |
|---|---|
| Enter | Follows the link. |
Built in
- External links open in a new tab safely and say so to screen readers.
You provide
- Link text that makes sense on its own.
API reference
Link
| Prop | Type | Default | Description |
|---|---|---|---|
childrenRequired | React.ReactNode | – | Names the destination ("the terms of service"), never "click here". |
variant | LinkVariant | "default" |
|
isExternal | boolean | – | Opens in a new tab with |
childrenRequiredReact.ReactNodeNames the destination ("the terms of service"), never "click here".
variantLinkVariantDefault"default"inlinein running text (always underlined),subtlein footers and legal rows.isExternalbooleanOpens in a new tab with
noopener noreferrerand shows the 12pxarrow-up-right.
Also takes 77 standard DOM and ARIA attributes (id, aria-label, event handlers…).