Sidebar
data
Sidebar: a vertical list of navigation items with optional badges
Terminal
$termuijs render sidebar
Installation
$ bunx termuijs add sidebar
Copies the source into src/components/sidebar/ and installs @termuijs/core, @termuijs/widgets.
Usage
ts
import { Sidebar } from '@termuijs/widgets'ts
new Sidebar(items: SidebarItem[], style: Partial<Style> = {}, opts: SidebarOptions = {})API Reference
Sidebar
| Prop | Type | Required | Description |
|---|---|---|---|
items | SidebarItem[] | required | — |
collapsed | boolean | optional | Whether the sidebar is collapsed |
collapsedWidth | number | optional | Collapsed width in cells (default: 3) |
activeColor | import('@termuijs/core').Color | optional | Active item highlight color |
badgeColor | import('@termuijs/core').Color | optional | Badge color |