Link
Inline text link in accent ink; `external` opens a new tab with an icon.
Code
import * as React from 'react';
import { Link } from '@fruit-labs/design';
export default function Demo() {
return (
<p
style={{
margin: 0,
fontSize: 15,
color: 'var(--label)',
}}
>
{'Read the '}
<Link href="#">pricing guide</Link>
{' or the '}
<Link href="#" external>
API docs
</Link>
.
</p>
);
}Install
From npm:
npm install @fruit-labs/design
import { Link } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/link.jsonGuidelines
- Link text names the destination, never "click here".
Props
| Prop | Type | Required |
|---|---|---|
href | string | Yes |
external | boolean | No |
className | string | No |
children | React.ReactNode | No |
Also accepts everything in Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>.