Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Sheet examples · Multi Section

Sheet with Tabs for React

A right-side project sheet with Overview, Activity and Settings tabs that switch the text below them.

Framework
UI library

Three views in one sheet: Tabs with the underline style switch between Overview, Activity and Settings, and the text under them changes with the tab. The tabs are uncontrolled and start on Overview, with arrow keys moving between them.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

How are the tabs built?

With Tabs, TabsList, TabsTrigger and TabsContent, mapped from a static array of three tabs. Overview is the default tab. TabsList uses variant="line", and each trigger and panel share a value.

How do people move between tabs with the keyboard?

Tab moves focus onto the selected tab, and the arrow keys move between tabs. Tab again moves into the panel.

How do I open the sheet on a given tab?

Control the tabs: keep the value in state, set it before you open the sheet, and update it on change. Pass value and onValueChange.

What's in each tab?

One paragraph of muted text per tab. Replace it with the real panel: a member list, an activity feed, a settings form.

How does Open Sheet open it?

The button labeled Open Sheet is the trigger, and its text is the accessible name. The Button goes in the render prop of SheetTrigger, and the label stays its child.

What does the sheet announce?

SheetTitle names the dialog for assistive tech, so every sheet renders one; hide it with sr-only when the design has no visible heading. It reads Project Details, with View and manage project information as the description.