Beta

Search Documentation

Search through documentation pages

Components

Link

A styled link component that wraps Next.js Link with variant and size support, and automatic external link handling.

Preview

'use client';

import { Link } from '@/registry/san-francisco/ui/link';

export default function LinkDemo() {
  return <Link href="#">Documentation</Link>;
}

Installation

bun
bunx shadcn@latest add @sft-ui/link

Variants

'use client';

import { Link } from '@/registry/san-francisco/ui/link';

export default function LinkDemoVariants() {
  return (
    <>
      <Link href="#" variant="default">
        Default
      </Link>
      <Link href="#" variant="muted">
        Muted
      </Link>
      <Link href="#" variant="block">
        Block
      </Link>
    </>
  );
}

Sizes

'use client';

import { Link } from '@/registry/san-francisco/ui/link';

export default function LinkDemoSizes() {
  return (
    <>
      <Link href="#" size="sm">
        Small
      </Link>
      <Link href="#" size="default">
        Default
      </Link>
      <Link href="#" size="lg">
        Large
      </Link>
    </>
  );
}

External URLs automatically open in a new tab with rel="noopener noreferrer".

'use client';

import { Link } from '@/registry/san-francisco/ui/link';

export default function LinkDemoExternal() {
  return <Link href="https://example.com">External Link</Link>;
}

Props

PropTypeDefaultDescription
variant"default" | "muted" | "block""default"The visual style of the link.
size"default" | "sm" | "lg""default"The text size of the link.
hrefstring | UrlObjectThe link destination. External URLs render as <a> tags.
classNamestringAdditional CSS classes to apply.

All Next.js Link props are supported for internal links.