Skip to content

pastetaste

Glass Rail

NavigationInteraction

Vertical frosted side navigation in dark and light glass; the active item is a solid disc that slides and stretches between items, with tooltips and exact icon colours.

Paste it into Claude Code: it installs the component, asks for your brand and content, and places it on the page you name.

Install

Or by hand, in a Next.js project with shadcn set up. It writes components/pastetaste/glass-rail.tsx.

npx shadcn@latest add https://pastetaste.com/r/glass-rail.json
Dependenciesmotion@^12.23.0

Prompt

Install the pastetaste component "Glass Rail" (glass-rail) into this Next.js project and use it.

What it is: Vertical frosted side navigation in dark and light glass; the active item is a solid disc that slides and stretches between items, with tooltips and exact icon colours.

Before you place it, ask me (one short message, in my language; "skip" = sensible default): which page and section it goes in, my brand colour (hex), the text, labels or images it should show, and whether I want my logo or my own copy in the demo content. Then:

Steps:
1. If the project has no components.json, run: npx shadcn@latest init -y -d. Then run: npx shadcn@latest add https://pastetaste.com/r/glass-rail.json
   (it writes components/pastetaste/glass-rail.tsx; install any npm packages it reports: motion@^12.23.0).
2. Import it: import { GlassRail } from "@/components/pastetaste/glass-rail" (check the file for the exact named export).
3. Put it where it fits on the page I name, keep the rest of the page untouched, and pass props for my colours instead of editing the installed file.
4. It does not depend on Tailwind; colours come from CSS variables (--pt-*) or props.
5. It supports prefers-reduced-motion with a still state; do not remove it.

Props (all optional unless the type has no default):
- items: { id: string; label: string; icon: ReactNode; href?: string; badge?: boolean | number }[] — Items top to bottom. label is the accessible name and the tooltip text. With href an item renders as a link.
- value: string — Active item id for controlled use.
- defaultValue: string = items[0].id — Starting item id when uncontrolled.
- onChange: (id: string, item: RailItem) => void — Called when a different item is chosen.
- variant: 'dark' | 'light' = 'dark' — Smoked glass with a white disc, or milk glass with a black disc.
- accent: string = var(--pt-accent, #ff4a2e) — The one accent: badge colour and focus ring.
- lead: ReactNode — Static top slot shown in a soft disc, for a brand mark.
- foot: ReactNode — Static bottom slot, for an avatar or a settings icon.
- tooltip: 'right' | 'left' | 'none' = 'right' — Side of the hover and focus label.
- halo: boolean = true — Thin outer outline around the rail.
- speed: number = 1 — Spring pace; 2 is twice as quick.
- label: string = 'Primary' — Accessible name of the navigation landmark.

Live preview: https://pastetaste.com/c/glass-rail
Then run the dev server, check it in the browser at desktop and mobile width, and tell me the page URL.

Props 12

PropTypeDefaultDescription
items{ id: string; label: string; icon: ReactNode; href?: string; badge?: boolean | number }[]-Items top to bottom. label is the accessible name and the tooltip text. With href an item renders as a link.
valuestring-Active item id for controlled use.
defaultValuestringitems[0].idStarting item id when uncontrolled.
onChange(id: string, item: RailItem) => void-Called when a different item is chosen.
variant'dark' | 'light''dark'Smoked glass with a white disc, or milk glass with a black disc.
accentstringvar(--pt-accent, #ff4a2e)The one accent: badge colour and focus ring.
leadReactNode-Static top slot shown in a soft disc, for a brand mark.
footReactNode-Static bottom slot, for an avatar or a settings icon.
tooltip'right' | 'left' | 'none''right'Side of the hover and focus label.
halobooleantrueThin outer outline around the rail.
speednumber1Spring pace; 2 is twice as quick.
labelstring'Primary'Accessible name of the navigation landmark.
View all →