Weftv0.4.0
GitHubFigma
Blade AI
Actions · Linkstable

Link

Takes people to another page, a file or another site. A native anchor with two variants (anchor, underlined inside text; button, a standalone link that underlines on hover), three colours, three sizes and an optional icon.

Preview

#preview

Switch variant, color, size, target and state. Show code opens the React and CSS below.

anchor · primary · medium · same tab · default
docs-link.tsx
import { Link } from "@blade-ai/weft/components/link";

export function DocsLink() {
  return (
    <Link
      href="https://blade.ai/docs"
    >
      Read the docs
    </Link>
  );
}

All states

#all-states

Every state from the Link spec, named. Medium unless noted.

Link · 15 states · size medium unless noted
Read the docs
Anchor · primary
Read the docs
Button · primary
Read the docs
Hover · anchor
Read the docs
Hover · button
Read the docs
Hover · neutral
Read the docs
Focus-visible
Read the docs
Focus-visible · white

Props

#props

Only children is required. Without href the link renders a button. Anything marked UNDEFINED is an open decision.

Prop
Type
Default
Description
children *
string
—
Link text. Says where the link goes, two to five words.
href
string
—
Destination. Renders a native <a href>. Without href the link renders a <button> (in-page actions only).
target
"_self" | "_blank"
"_self"
"_blank" opens a new tab and adds the external icon plus a visually hidden "(opens in new tab)".
rel
string
"auto"
Link relationship. Set to "noopener noreferrer" automatically when target is _blank.
variant
"anchor" | "button"
"anchor"
anchor: inside text, always underlined. button: standalone, underlined on hover.
color
"primary" | "neutral" | "white"
"primary"
primary (green) for most links, neutral inside dense UI, white on dark surfaces.
size
"small" | "medium" | "large"
"medium"
Type size 12 / 14 / 16px. Inline anchors should match the surrounding text size.
icon
IconComponent
—
Icon shown with the label, aria-hidden. One icon per link.
iconPosition
"left" | "right"
"left"
Icon before or after the label. External links use right.
isDisabled
boolean
false
Removes href and sets aria-disabled="true". Whether it applies to the anchor variant is UNDEFINED · needs decision.
onClick
(event) => void
—
Click handler. Not called when isDisabled.
accessibilityLabel
string
—
Accessible name (aria-label) when the visible text alone is not enough. Must start with the visible text.
htmlTitle
string
—
Native tooltip text. Never the only place for important information.
testID
string
—
Test hook, rendered as data-testid.

Usage

#usage

Short rules for writing and choosing links.

Do
Use a native <a href> for navigation; fall back to <button> only without href.
Underline every link inside running text (variant = anchor).
Add the external arrow, rel="noopener noreferrer" and hidden "(opens in new tab)" to external links.
Write link text that names the destination, two to five words.
Use Theme tokens for colour and Global tokens for size; no component tokens.
Don't
Don't use a link for actions that change data; use Button.
Don't make Space follow an <a href>.
Don't show the ring on mouse click.
Don't use "click here" or link a whole sentence.
Don't use any product name but Blade AI in sample copy.

Accessibility

#accessibility

Native link and button behaviour. Enter follows an anchor; Space does not.

Keyboard
Key
Action
Tab / Shift+Tab
Moves focus to and from the link; ring shows (:focus-visible).
Enter
<a href> follows the link. <button> fallback runs onClick.
Space
<a href>: nothing. <button> fallback: runs onClick on release.
Click
Follows the link or runs onClick. Ignored when disabled.
Shift+Enter
Browser default: opens in a new window.
ARIA
Element
Role / attribute
When
a
href
destination; removed when disabled
a
target
"_blank" for external links
a
rel
"noopener noreferrer" when target is _blank
a
aria-label
accessibilityLabel, only when set
a
title
htmlTitle, only when set
span.sr-only
text
"(opens in new tab)" when target is _blank
a (disabled)
aria-disabled="true"
isDisabled; href removed
button (no href)
type="button"
Always
icon svg
aria-hidden="true"
Always
a
data-testid
testID

Agent Spec

#agent-spec

Machine-readable spec, tables (a)–(h). Same source as /specs/link.json. Anything marked UNDEFINED needs a decision before it is built.

/specs/link.json·component: "Link"·package: "@blade-ai/weft"·updated 2026-11-24
[
  "Pressed colour (no Theme token; hover is reused)",
  "Hover / pressed colour for color=\"white\"",
  "Whether isDisabled applies to variant=\"anchor\"",
  "Whether a disabled link stays in the tab order (it drops its href, so it leaves it)",
  "Visited style (the old Weft Link had none)",
  "Colour transition (no motion tokens in the file)",
  "Minimum touch target for standalone links on mobile",
  "Focus border on dark surfaces"
]