Sidebar
Icon Rail
NewA narrow column of icons with one tooltip that glides between them and an active pill that slides to the picked icon.
npx motionsnack add icon-railCustomize
<IconRail />Props
10 properties
| Property | Type | Default | Description |
|---|---|---|---|
| items | { value?: string; label: string; icon: IconRailIcon; href?: string; dot?: boolean }[] | 5 demo icons | Icons at the top. Icons: home, inbox, folder, calendar, chart-column, users, file, settings, circle-help, search, bell, star, layers. An empty or '#' href renders a button. |
| footerItems | IconRailItem[] | Help, Settings | Icons pinned to the bottom of the rail. |
| header | ReactNode | - | Slot above the icons, such as a logo. |
| footer | ReactNode | - | Slot under the bottom icons, such as an avatar. |
| value | string | - | Controlled current item (its value). |
| defaultValue | string | first item | Current item on first render when uncontrolled. |
| onChange | (value: string) => void | - | Called with the value of the item the user picked. |
| linkComponent | ElementType | 'a' | Renders every item link, e.g. the app's router link. |
| className | string | '' | Extra classes on the rail. |
| surface | boolean | true | Draw the rail on its own card. Off: transparent, fills its parent's height. |
About Icon Rail
Icon Rail is the slim navigation of apps with only a few sections. Each destination is an icon button; the active one sits on a soft pill that slides to whichever icon you pick. A single tooltip labels the icons: it opens after a short delay, then glides from icon to icon and swaps its text through a quick blur instead of hiding and reappearing. Icons can carry a dot for unread items, a second group is pinned to the bottom, and slots above and below take a logo or an avatar. It can sit on its own glass card or stay transparent and fill the height of an app shell.
What's included
- Active pill that slides between icons
- One tooltip that glides between icons
- Dots for unread items
- Bottom group and header / footer slots
- Glass card or transparent full-height rail
- Controlled and uncontrolled value
- Light and dark look, respects reduced motion
- Type
- Animated React sidebar component
- Library
- Components · Sidebar
- Stack
- Next.js, React, Tailwind CSS, Framer Motion
- Added
- 2026-11-24
- Install
npx motionsnack add icon-rail