Back to elements
ElementNavigationFree

Side Tab Menu React component

A vertical tab menu for settings pages: tabs with icons, second-line descriptions and count badges, grouped under headings, an active highlight with a rail that slides between them, and a panel that fades to the chosen tab. Stacks on phones.

When to use the Side Tab Menu component

Use Side Tab Menu for settings, account and admin screens with more sections than fit in a row of tabs, especially when each section wants a short description.

For a few sections above the content, use Tabs; for app-wide navigation, use Sidebar.

Installation

Add the Side Tab Menu component to your project with the shadcn CLI. It lands in components/side-tab-menu.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add @reactframe/side-tab-menu

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install motion clsx tailwind-merge

Props

<SideTabMenu /> accepts 10 props (required ones are marked *).

  • tabs*
    SideTab[]
  • value
    string
  • defaultValue
    string
  • onValueChange
    (id: string) => void
  • menuWidth

    Width of the tab column.

    number
    Default: 232
  • compact

    Hide descriptions to make the menu compact.

    boolean
    Default: false
  • showPanel

    Render the panel next to the menu (tabs with content). Off: just the menu.

    boolean
    Default: true
  • label
    string
    Default: "Settings"
  • theme
    "dark" | "light"
    Default: "dark"
  • className
    string

FAQ

Does it follow the tabs pattern?
Yes: role tablist with aria-orientation vertical, tabs with aria-selected and aria-controls, a roving tabindex and arrow-key, Home and End navigation.
Can I use it only as a menu?
Set showPanel={false} and render your own content (or route) from onValueChange.
What happens on phones?
Below the sm breakpoint the menu sits on top and the panel below it, full width.

Related components

Dot Pager Indicator
Free
Language Switcher
Free
Vertical Progress Steps
Free
Scrollspy Anchor Links
Free
Table of Contents
Free
Timeline
Free