‹ components

Lane

stablev1.0.0·open in canvas

Segmented control (e.g. Following / Everyone). Fill is the state — no underline.

Installnpx shadcn add @cids/lane
Live demo

Motion · tap to replay

honors reduced-motion

`--motion-fast` (150ms) on background-color / color / box-shadow as selection moves. Reduced-motion: neutralized by the global reset.

Brand chip remounts on tap · highlighted tokens are named in this component's doc · spring is budgeted to human feedback only.

import { Lane } from "@/design-system";

const [lane, setLane] = useState("following");

<Lane
  options={[
    { value: "following", label: "Following" },
    { value: "everyone", label: "Everyone" },
  ]}
  value={lane}
  onChange={setLane}
/>

Tokens · live

Resolves in the active theme — flip the toggle above to verify.

States · from doc

Parsed from the doc. Interact with the live demo for hover/active.

**Inactive** — `text-fg-muted`transparent.**Press** — `scale `.

Segmented control (e.g. Following / Everyone). Fill is the state — no underline.

Anatomy

┌ surface-container, r-2, p-3, border outline-variant ┐
│ ┌──────────┐  ┌──────────┐                          │
│ │Following │  │ Everyone │  ← active: bg-brand +     │
│ └──────────┘  └──────────┘    on-brand + mint glow;  │
│   active         inactive     inactive: fg-muted     │
└──────────────────────────────────────────────────────┘

Props

PropTypeDefaultNotes
optionsLaneOption<T>[]—{ value, label }. Generic T extends string keeps value/onChange type-safe.
valueT—Controlled selected value.
onChange(value: T) => void—Fired on segment tap.
classNamestring—Merged via cn.

Motion

--motion-fast (150ms) on background-color / color / box-shadow as selection moves. Reduced-motion: neutralized by the global reset.

A11y

←/→ move selection and focus (wrapping) · Home/End jump to

first/last.

Self-contained: copy the folder into any Tailwind+React app, or use the install command above. Docs and this page render the same file on disk — they cannot drift.