Skip to content

Glass Sidebar for React

A glass sidebar navigation for React with grouped items, icons and counts that collapses into an icon rail with tooltips.

npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/vertical-nav.json

3 reviews waiting.

Click items to watch the highlight slide; toggle the rail. On a phone, collapse it to see the page beside it.

Inbox

Files to copy

8 folders · 8 files · 4 packages
From theme/src/
  • components/vertical-nav/
  • components/drawer/parts/sheet.tsx
  • components/navbar/
  • components/popover/
  • hooks/{use-latest.ts, use-media-query.ts, use-preferences.ts}
  • motion/tokens.ts
  • lib/{cn.ts, form.ts, popup-motion.ts}
  • styles/
shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/vertical-nav.jsonRegistry item: vertical-nav. The styles need the Tailwind v4 glass UI setup.
The examples also use
  • components/avatar/
  • components/glass-card/
  • components/logo/
  • motion/light-follower.ts
  • lib/{heading.ts, initials.ts}
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/avatar.json https://lokendra-builds.github.io/sheenui/r/glass-card.json https://lokendra-builds.github.io/sheenui/r/logo.json
Packages
pnpm add @base-ui/react clsx motion tailwind-merge

Text only, for settings

Icons, titles and the header are all optional. A badge still counts things to look at.

Props

PropTypeDefaultDescription
sections (required)VerticalNavSection[]NoneGroups of items, each with an optional heading.
value (required)stringNoneSets the value of the active item when controlled.
onValueChange((value: string) => void)NoneCalled with an item's value when it is chosen (a plain left click on a link also calls it).
renderLink((props: NavLinkProps, item: VerticalNavItem) => ReactElement)a plain <a>Render items that have an href through your router's link component. Same contract as Navbar's renderLink (see NavLinkProps).
headerReactNodeNoneLogo / product name at the top. Left-aligned; a 28px mark sits centred on the rail.
footerReactNodeNonePinned to the bottom, e.g. a user card or settings. Clipped (not reflowed) on the rail.
collapsedbooleanfalseIcon-only rail; labels appear as tooltips.
labelsPartial<VerticalNavLabels>defaultVerticalNavLabelsEvery string, for translation: { name: "Sidebar" } (the default landmark name). Every other string, for translation: labels={{ name: "…" }}; omitted keys keep the English of defaultVerticalNavLabels. Its only key is listed in the key table under the props table.
aria-labelstringlabels.name ("Sidebar")Landmark name. Give each navigation on a page its own.
landmarkbooleantrueWhether the <nav> is a navigation landmark (boolean). Set false (a named role="group") for a nav inside a block that can appear twice on one page, so landmark names stay unique.
classNamestringNoneExtra classes for the <nav> (set its height; it fills its parent by default).
VerticalNavLabels keys and English defaults (1)
Pass any key in labels; the rest keep the defaults of defaultVerticalNavLabels.
KeyEnglish default
nameSidebar

Keyboard

KeysAction
Tab/Shift + TabMove between items; a normal list of links and buttons.
Enter/SpaceFollow a link or select an item.

Accessibility

  • A <nav> with a list; the current item has aria-current="page". Name the nav with aria-label.
  • In the icon rail every item keeps its text as an accessible name and shows it in a tooltip on hover and focus.
  • Under reduced motion the rail snaps open and shut in one frame.

All exports on this page

  • VerticalNav — Vertical (sidebar) navigation on glass.
  • defaultVerticalNavLabels — The English VerticalNavLabels used when labels is omitted; a partial labels prop is merged over it.

When to use the vertical nav

  • Use it as a React sidebar for an admin dashboard, with Workspace and Account sections, icons on every row and an unread badge on Inbox, so people can reach any screen in one click.
  • Use it for a settings page where Profile, Security, Notifications and Billing sit in a narrow column beside the form, with no icons or section titles needed.
  • The collapsed prop turns it into an icon-only rail, which suits apps where the content area needs the width on small laptops but power users still want one-click navigation.
  • Skip it when the navigation has only a few top-level destinations and lives across the top of the page; Horizontal nav fits there, and Tabs fits switching views inside a single page.
  • Pair it with Avatar in the footer slot for the signed-in user, SheenLogo in the header, and Tooltip behavior already built in for the collapsed rail.

Frequently asked questions

67 components pages in all: browse them on All components.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .