Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Header Actions Sidebar Block for React

A notes app in a fixed-height window whose slim sidebar header holds three ghost icon buttons with tooltips: New note adds and opens a note, Search filters the notes, and the third folds the rail.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Put the three things you do most at the top of the sidebar with this header actions sidebar for React with Base UI. A window framed by a hairline with a plus mark on each corner holds a slim Sidebar whose header carries three ghost icon Buttons, each with a Tooltip. New note adds an untitled note at the top of Notes, opens it on the page and puts focus on its row. Search swaps the Notes label for a search field that filters the eight typed notes by title and text, with the slash key as a shortcut shown in the tooltip and Escape to close it. The third button is the sidebar's own trigger and folds the rail, where only it and the note icons remain. The page is the open note's text under its title. It's built from Sidebar, Button, Tooltip, Kbd, Avatar and Guides, with a CSS entrance only. Below the medium breakpoint the rail is a sheet opened from the top bar. For notes, docs, drafts and any app whose sidebar needs a create button and a filter.

FAQ

What does New note do?

It adds an "Untitled note" at the top of the Notes list in the block's own state, makes it the open note, closes the search if it was open and moves focus to the new row, so you can start working with the keyboard. Press it again and the next one is "Untitled note 2". The page shows a short placeholder, because nothing here is edited or saved; the notes live in NOTES and in the block's state until the page reloads.

What happens when the sidebar collapses?

The rail folds to its icons: the New note and Search buttons and the search field go with the labels, and the sidebar trigger stays under the mark with a tooltip that now says "Expand sidebar". Each note keeps its icon with a tooltip showing its title. The provider is set with persist={false} and shortcut={false}, so the block writes no cookie and leaves Ctrl and Command with B to the page it sits on.

What stays in the page, and how do I connect it?

Everything. The eight notes are typed in NOTES; New note, the search and the open note all work on the block's own state, and nothing is saved, synced or shared. Replace the handlers with your API and keep the same split: create, then open and focus the new note; search, then filter the list. The notes are links to # whose handler shows the note instead of navigating. They're SidebarMenuButtons with render set to an a element.

How does it work on a phone?

Below the medium breakpoint the sidebar is a sheet opened by the menu button in the top bar, from the start edge, the right in a right-to-left layout. The header's buttons are inside it: New note adds a note and focuses its row without closing the sheet, Search opens the field in the list, and choosing a note closes the sheet and shows it. The window keeps its height.

Is it accessible?

All three header buttons are named, whatever their tooltips say: "New note", "Search notes" (a toggle that reports whether the field is open) and "Toggle Sidebar". Tooltips open on focus as well as on hover. The notes are links in a navigation landmark named after the product, the open one marked as the current page. One polite status line reports a new note, the search count and each note you open, and the open note is a scrollable region you can reach with Tab, named by its title.

  • Pro

    Brand Header Sidebar

    Headers and sections

    A design-operations suite in a fixed-height window whose sidebar header is a brand lockup that opens a menu to go home, copy the logo name, copy the mark as SVG or open the brand guidelines.

  • Pro

    A project workspace in a fixed-height window whose sidebar rows each hold Pin, Duplicate and Archive buttons, with a real Undo in the footer that puts an archived project back in its old place.

  • Pro

    A mail client in a fixed-height window: mailboxes and labels whose counts follow the mail you file, a searchable message list beside the open message, and Compose for a local draft.

  • Pro

    Scrollable Content Sidebar

    Headers and sections

    An all-in-one workspace in a fixed-height window whose wide sidebar scrolls six groups of pages under sticky group labels, with a line that says which group is at the top and a Jump to select that scrolls to one.

  • Pro

    Separator Sections Sidebar

    Headers and sections

    A team hub in a fixed-height window whose sidebar tells its three sections apart three ways, with labels, with hairlines or with space alone, chosen from a segment group while the ten rows and the open page stay put.

  • Pro

    Simple Groups Sidebar

    Headers and sections

    A company handbook in a fixed-height window whose muted sidebar has four groups of pages and a density toggle: Roomy, Default and Compact set the size of the rows and the gaps, and the rail prints the measured row height.