How It Works

Numbered steps section whose connector draws from marker to marker as it scrolls into view, lighting each marker as the line arrives; horizontal on wide containers and a vertical timeline on narrow ones, with optional per-step media that cross-fades when a step is hovered, focused or chosen with arrow keys like a tab.

Preview

How It Works preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/how-it-works
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

steps
HowItWorksStep[]

3–5 steps read best; more still work.

—
eyebrow?
ReactNode
—
heading?
ReactNode
—
description?
ReactNode
—
value?
string

Controlled active step id (only meaningful when steps carry `media`).

—
defaultValue?
string

Initial active step id when uncontrolled. Defaults to the first step.

—
onValueChange?
((id: string) => void)
—
segmentDuration?
number

Seconds the connector takes to travel between two markers. Default 0.45.

0.45
className?
string
—
mediaClassName?
string

Classes for the media panel (aspect ratio, height).

—

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.

Updated