Skip to content

Row

A clickable line in a list or menu, with an icon or control at the start, a label, and actions at the end. It has an active state, and a drag handle is available for reorderable lists.

// Plain markup
import { Row, RowDragHandle } from "@shavin/ui";

Side menu navigation

Leading icon and active state. NavItem is built on this.

Component Source
const [active, setActive] = useState("due");

<div className="w-64 space-y-0.5 rounded-[var(--radius-panel)] border border-hairline bg-surface p-2">
  <Row leading={<Icon name="bell" size="sm" color="inherit" />} active={active === "due"} onClick={() => setActive("due")}>
    Due & renewals
  </Row>
  <Row leading={<Icon name="bell" size="sm" color="inherit" />} active={active === "money"} onClick={() => setActive("money")}>
    Money
  </Row>
</div>

Trailing content

Component Source
<div className="w-72 space-y-0.5">
  <Row trailing={<Badge variant="soft" tone="brand">3</Badge>}>Inbox</Row>
  <Row trailing={<Icon name="chevron-right" size="sm" color="muted" />}>Settings</Row>
  <Row trailing={<span className="text-xs text-fg-subtle">⌘K</span>}>Search</Row>
</div>

Checkbox or radio as the leading slot

Checkbox list
emi
subs
bills
Radio list
weekly
monthly
yearly
Component Source
{/* Checkbox list */}
{["emi", "subs", "bills"].map((k) => {
  const isChecked = checked.includes(k);
  return (
    <Row
      key={k}
      as="div"
      onClick={toggle}
      leading={<Checkbox aria-label={k} checked={isChecked} onCheckedChange={toggle} />}
      className="cursor-pointer capitalize"
    >
      {k}
    </Row>
  );
})}

{/* Radio list */}
<RadioGroup value={radio} onValueChange={setRadio}>
  {["weekly", "monthly", "yearly"].map((k) => (
    <Row
      key={k}
      as="div"
      onClick={() => setRadio(k)}
      leading={<Radio value={k} aria-label={k} />}
      className="cursor-pointer capitalize"
    >
      {k}
    </Row>
  ))}
</RadioGroup>

Draggable list card

Netflix
Car EMI
Electricity
Component Source
<Row
  as="div"
  className="border border-hairline bg-surface"
  leading={<RowDragHandle />}
  trailing={<button aria-label="Remove">✕</button>}
>
  Netflix
</Row>

Several click targets

Use as="div" so there is no outer button.

Component Source
<Row
  as="div"
  leading={<button aria-label="Toggle visibility" className="border-danger h-4 w-4 rounded-[3px] border-2" />}
  trailing={<button aria-label="Info">ⓘ</button>}
>
  <button className="text-left hover:underline">Subscriptions</button>
</Row>

Props

PropTypeDefaultDescription
asElementTypeforPolymorphic element tag: "button" (default for single click target) or "div" (for nested interactive controls).
leadingReactNode—Icon, color dot, Checkbox, Radio, or drag handle leading slot.
trailingReactNode—Chevron, Badge, secondary text, or hover-revealed action button trailing slot.
childrenReactNode——
classNamestring——
active"true" | "false""false"—
Configure Theme
Theme
Brand Color
Custom
Gray Family
Appearance
Radius
Scaling
Panel Style
Heading Font
Body Font