Navbar, sidebar


Install
npx shadcn add @klarhimmel/navbar-sidebarDetailsAbout, usage, props and more
Navigation as a left column: the brand on top, stacked links and a button at the bottom, with an optional heading and lead in the content beside it.
Import
Import
- navigation/sidebar
- header/sidebar
- About
- Navigation as a left column: the brand on top, stacked links and a button at the bottom, with an optional heading and lead in the content beside it.
- Category
- The bar at the top of every page: brand, links, one action. New project? Set it up once: /get-started/installation.
Notes
When to use it
Pick it for an app or docs style page where the navigation is a left column beside the content: brand on top, stacked links, a button at the bottom. Turn the top bar on for a dashboard feel with search and an account chip above. For a bar across the top with links in a row use navbar-simple; for a shop header with categories use navbar-search.
Writing for it
- The brand holds 40 characters, a link label 40, and one to eight links fit the column. - The title holds 80 characters and the lead 240; both are optional and the content area draws only what is set. - The search label holds 60 and the initials 3; with the top bar on, clear the column button and use the two actions in the content instead.
Watch out for
The column is tall, so put this block first on a page and give it content of its own; below it, other sections lose the left edge. Keep link labels short, or the column grows wider than its 18rem slot and wraps.
Pairs well with
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
Props
The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.
| Prop | Type | Default | Description |
|---|---|---|---|
brand | string | 'Write the business name' | Text, up to 40 characters. |
mark | { paths, viewBox, src } | - | Fields: paths (optional), viewBox (optional), src (optional). Optional; empty is not rendered. |
brandHref | string | - | Text, up to 300 characters. Optional; empty is not rendered. |
topBar | 'none' | 'search' | 'none' | One of 'none', 'search'. Optional; empty is not rendered. |
links | Link[] | 3 items | List of 1 to 8. |
linksLabel | string | 'Name the link column' | Text, up to 60 characters. |
cta | Link | {…} | Optional; empty is not rendered. |
search | { label, placeholder, href } | - | Fields: label (optional), placeholder (optional), href (optional). Optional; empty is not rendered. |
profile | { name, initials, href } | - | Fields: name (optional), initials (optional), href (optional). Optional; empty is not rendered. |
eyebrow | string | '' | Text, up to 60 characters. |
title | string | 'Say what this page is about' | Text, up to 80 characters. |
description | string | 'Say in one or two sentences what th…' | Text, up to 240 characters. |
primary | Link | - | Optional; empty is not rendered. |
secondary | Link | - | Optional; empty is not rendered. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |