Skip to content
esc

Link

Navigationshadcn/ui

Text link for prose and secondary navigation: 'Forgot password?', 'Terms', 'See all'. `external` opens a new tab and shows an arrow.

When to use

  • Say where it goes: 'View statement', not 'Click here'.
  • Use 'inline' inside body text so the link is visible without color.
  • Don't use a Link for an action that changes data; use Button variant='link' or a Button.
  • Don't open internal pages in a new tab.

Accessibility

Role
link
Keyboard
Tab focuses. Enter follows.
Notes
External links announce '(opens in a new tab)'.
Note
Focus ring uses color.border.focus.

Props

  • variant= 'default'

    'default' | 'muted' | 'inline'

    Look.

  • external= false

    boolean

    target='_blank', rel='noopener noreferrer' and the arrow icon.

  • asChild= false

    boolean

    Style your router's link: <Link asChild><NextLink href='/terms'>Terms</NextLink></Link>.

Prompt for your agent

Use the UnbuiltUI Link. Call unbuilt_get_component("Link") first and follow its spec: variants, states, usage rules and accessibility.

unbuilt_get_component returns

3 variants3 states3 props4 usage rules4 a11y notes6 tokens2 examples

Add it with shadcn

$npx shadcn add https://unbuiltui.com/r/link.json

Tokens · 6

accent.defaultaccent.hoverfg.mutedfg.defaultborder.subtleborder.focus