Side Rail navbar
Left sidebar navbar: a slim bar down the left edge; the section you're reading fills a hairline.
Features
- Logo at the top, sections stacked in the middle, the button and a note at the foot
- Each link has a short hairline; the one you're reading grows into a track that fills as you read
- Progress updates without re-rendering, so scrolling stays smooth
- Below large screens it becomes a plain top bar with a menu
- Give the page lg:pl-56 so the content starts beside the rail
Best for: Portfolios, photographers and long single pages that want the whole width for the work.
Installation
npm install motion @radix-ui/react-slot class-variance-authority clsx tailwind-mergeThen copy the files from the Code tab into the same paths in your project, in TypeScript or JavaScript.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| logo | ReactNode | - | Your logo. It inherits currentColor. |
| items | NavItem[] | - | One link per section, in page order: label and #id href. |
| cta | { label: string; href: string } | - | Optional button at the rail's foot. |
| footnote | ReactNode | - | Optional quiet line under the button. |
| className | string | - | Extra classes for the rail. |
FAQ
Is the Side Rail navbar free to use?
Yes. Side Rail is free to copy into your own projects. Open the Code tab and paste the files into your app.
Does Side Rail work with Next.js and React?
Yes. It's a React client component made for the Next.js App Router, styled with Tailwind CSS and animated with Framer Motion (the motion package).
Can I use Side Rail in JavaScript instead of TypeScript?
Yes. Every file comes in TypeScript and JavaScript. Switch the language in the Code tab.
What does Side Rail need installed?
motion, @radix-ui/react-slot, class-variance-authority, clsx, tailwind-merge, plus the shared helpers from the Installation page.
Is Side Rail accessible?
Every link and button is reachable by keyboard with a visible focus ring, and the animation stays still for visitors who ask for reduced motion.