Preview Rail

A slim navigation rail of short tick marks, modeled on the Codex app: hovering swells the ticks near the pointer into a pyramid and floats a card with the destination's label and details. Runs vertically or horizontally and accepts your own preview renderer.

Preview

Preview Rail preview width

Install

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

$ bunx --bun shadcn add @karaui/preview-rail
@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

items
PreviewRailItem[]
—
label?
string
Section navigation
orientation?
"horizontal" | "vertical"
vertical
activeId?
string
—
defaultActiveId?
string
—
onActiveChange?
((id: string) => void)
—
onItemSelect?
((item: PreviewRailItem) => void)
—
renderPreview?
((item: PreviewRailItem) => ReactNode)
—
showPreview?
boolean
true
previewSide?
"before" | "after"
after
highlightActive?
boolean
false
itemSize?
number
24
className?
string
—
railClassName?
string
—
previewContainerClassName?
string
—
previewClassName?
string
—

Updated