Components · Content
Link
A link that opens in a new tab. Only absolute http, https, and mailto URLs are allowed; leave href out for a mockup link that goes nowhere. variant: inline (default, underlined), nav (a plain menu link), or muted (small and quiet, for footers). active marks the current page. icon puts an icon by name (see Icon) at the start or the end (iconPosition); an inline link with an href ends with its own arrow, so its icon goes at the start.
ExamplesLink to this section
Show JSONHide JSON
{
"version": 1,
"root": "stack",
"elements": {
"stack": {
"type": "Stack",
"props": { "gap": "sm" },
"children": ["docs", "mail"]
},
"docs": {
"type": "Link",
"props": {
"label": "Base UI documentation",
"href": "https://base-ui.com"
}
},
"mail": {
"type": "Link",
"props": { "label": "Email the team", "href": "mailto:team@example.com" }
}
}
}Without `href` a link is the same words in the same style, going nowhere.
Show JSONHide JSON
{
"version": 1,
"root": "stack",
"elements": {
"stack": {
"type": "Stack",
"props": { "direction": "horizontal", "gap": "lg" },
"children": ["product", "pricing", "privacy"]
},
"product": {
"type": "Link",
"props": { "label": "Product", "variant": "nav", "active": true }
},
"pricing": {
"type": "Link",
"props": { "label": "Pricing", "variant": "nav" }
},
"privacy": {
"type": "Link",
"props": { "label": "Privacy", "variant": "muted" }
}
}
}A link that leaves the page already ends with an arrow, so its icon goes at the start.
Show JSONHide JSON
{
"version": 1,
"root": "stack",
"elements": {
"stack": {
"type": "Stack",
"props": { "direction": "horizontal", "gap": "lg" },
"children": ["guide", "solutions", "sales"]
},
"guide": {
"type": "Link",
"props": {
"label": "Read the guide",
"href": "https://example.com/guide",
"icon": "book"
}
},
"solutions": {
"type": "Link",
"props": {
"label": "Solutions",
"variant": "nav",
"icon": "chevron-down",
"iconPosition": "end"
}
},
"sales": {
"type": "Link",
"props": { "label": "Call sales", "variant": "muted", "icon": "phone" }
}
}
}PropsLink to this section
Generated from the zod schema the server validates with. Unknown props are ignored with a warning. Any prop can also be a dynamic value such as { "$state": "/path" }; it is checked again once it resolves.
| Prop | Type | Limits and defaults |
|---|---|---|
| labelrequired | string | max 200 chars |
| href | string | max 2,000 chars |
| variant | "inline" | "nav" | "muted" | — |
| active | boolean | — |
| icon | "file-text" | "notes" | "notebook" | "book" | "book-2" | "writing" | "pencil" | "feather" | "quote" | "report" | "presentation" | "clipboard" | "archive" | "folder" | "paperclip" | "link" | "checklist" | "list-check" | "clipboard-list" | "clipboard-check" | "list-details" | "map" | "route" | "target" | "flag" | "compass" | "timeline" | "sitemap" | "hierarchy" | "gavel" | "scale" | "rocket" | "bulb" | "brain" | "search" | "microscope" | "flask" | "school" | "atom" | "language" | "code" | "terminal-2" | "brackets" | "git-branch" | "git-pull-request" | "git-merge" | "api" | "bug" | "puzzle" | "plug" | "tool" | "settings" | "adjustments" | "components" | "layout-dashboard" | "robot" | "package" | "database" | "server" | "cloud" | "cpu" | "table" | "chart-bar" | "chart-line" | "chart-pie" | "chart-dots" | "trending-up" | "stack-2" | "versions" | "calendar" | "calendar-event" | "clock" | "hourglass" | "alarm" | "refresh" | "lock" | "key" | "shield" | "shield-check" | "fingerprint" | "eye" | "users" | "user" | "message-circle" | "mail" | "bell" | "speakerphone" | "lifebuoy" | "circle-check" | "alert-triangle" | "info-circle" | "help-circle" | "ban" | "bolt" | "flame" | "sparkles" | "star" | "heart" | "trophy" | "home" | "building" | "briefcase" | "currency-dollar" | "shopping-cart" | "world" | "palette" | "photo" | "device-laptop" | "device-mobile" | "coffee" | "leaf" | "arrow-right" | "arrow-left" | "arrow-up-right" | "chevron-right" | "chevron-left" | "chevron-down" | "chevron-up" | "check" | "x" | "plus" | "minus" | "menu-2" | "dots" | "external-link" | "download" | "upload" | "send" | "player-play" | "trash" | "copy" | "filter" | "share" | "bookmark" | "tag" | "at" | "phone" | "map-pin" | "credit-card" | "gift" | "truck" | "thumb-up" | "login" | "logout" | "sun" | "moon" | "brand-github" | "brand-gitlab" | "brand-x" | "brand-linkedin" | "brand-youtube" | "brand-instagram" | "brand-facebook" | "brand-tiktok" | "brand-discord" | "brand-mastodon" | "brand-bluesky" | "brand-threads" | "brand-reddit" | "brand-twitch" | "brand-dribbble" | "brand-behance" | "brand-medium" | "brand-apple" | "brand-google" | "brand-windows" | "brand-android" | — |
| iconPosition | "start" | "end" | — |
RulesLink to this section
- Only absolute http, https, and mailto URLs pass validation. Links open in a new tab.
- Leave
hrefout for a link that goes nowhere. Relative and#addresses are refused. iconnames an icon (see Icon) drawn at the start, or at the end withiconPosition: "end". An inline link with anhrefends with its own arrow, so its icon must go at the start; nav and muted links, and a link withouthref, take either side.
Children and eventsLink to this section
Link is a leaf: it does not show children. Validation warns when a leaf has some; wrap them in a Stack or Card instead.
It emits no events.