DocsComponentsTemplatesThemesGitHub

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.json

Guidelines

  • Link text names the destination, never "click here".

Props

PropTypeRequired
hrefstringYes
externalbooleanNo
classNamestringNo
childrenReact.ReactNodeNo

Also accepts everything in Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>.

Edit this example on GitHub