Active Bar
The sliding highlight behind the active item in a vertical navigation list.
Example
Place it inside a relative list that sets --item-height. Move it by changing top; the bar animates between items.
Installation
pnpm dlx shadcn@latest add @narakui/active-barAdd "@narakui": "https://ui.narakcode.dev/r/{name}.json" to components.json, or install directly from https://ui.narakcode.dev/r/active-bar.json.
Usage
import { ActiveBar } from '@/components/ui/active-bar';<nav className="relative flex flex-col [--item-height:32px]">
<ActiveBar top={activeIndex * 32} />
</nav>Properties
| Prop | Type | Default | Description |
|---|---|---|---|
top | number | Required | Vertical offset in pixels of the active item. |
leftOffset | number | 0 | Inset from the left edge in pixels. |
rightOffset | number | 0 | Inset from the right edge in pixels. |
className | string | — | Additional classes, for example a z-index or custom transition. |