App sidebar, icon rail


Install
npx shadcn add https://ui.klarhimmel.com/r/app-sidebar-rail.jsonDetailsAbout, usage, props and more
An app's side navigation as a narrow rail of icons beside every page: the product's initial on top and up to eight places whose names show in tooltips (on hover and…
Import
Import
- app/sidebar-rail
- About
- An app's side navigation as a narrow rail of icons beside every page: the product's initial on top and up to eight places whose names show in tooltips (on hover and keyboard focus). On a phone it folds into a menu.
- Category
- Interface sections for signed-in products. New project? Set it up once: /get-started/installation.
Notes
When to use it
An app's side navigation as a narrow rail of icons: the product's initial on top and up to eight places whose names show in tooltips on hover and keyboard focus. Use app-sidebar-flat when names should always be visible.
Writing for it
- Choose icons that people know at a glance, since the name appears only on hover or focus. - Write each name short enough for a tooltip, one or two words. - Set the current page to the label of one place so it is marked.
Watch out for
A rail saves width but hides names, so a new user has to hover to learn it. On a phone it folds into a menu and the names return as text.
Pairs well with
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
Props
The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.
| Prop | Type | Default | Description |
|---|---|---|---|
brand | string | 'Name the product' | Text, up to 30 characters. |
navLabel | string | 'Main navigation' | Text, up to 40 characters. |
items | { label, icon, href, badge }[] | 4 items | List of 1 to 8. Each item: label, icon ('zap' | 'shield' | 'layers' | 'globe' | 'sparkles' | 'clock' | 'code' | 'palette' | 'lock' | 'chart' | 'users' | 'mail' | 'heart' | 'rocket' | 'search' | 'settings' | 'check' | 'star' | 'book' | 'box' | 'cloud' | 'compass' | 'leaf' | 'gauge'), href, badge (optional). |
active | string | 'First page' | Text, up to 30 characters. |