Skip to content
Klarhimmel UI

App sidebar, grouped

App sidebar, grouped previewApp sidebar, grouped preview

Install

npx shadcn add https://ui.klarhimmel.com/r/app-sidebar-grouped.json
DetailsAbout, usage, props and more

An app's side navigation as chrome beside every page: the product's name, an optional search field, places in up to four groups of six (a group can open and close), and…

Import

Import

import Block from '@/components/klarhimmel/blocks/app-sidebar-grouped';
Also called
  • app/sidebar-grouped
About
An app's side navigation as chrome beside every page: the product's name, an optional search field, places in up to four groups of six (a group can open and close), and the signed-in person at the foot. On a phone it folds into a menu.
Category
Interface sections for signed-in products. New project? Set it up once: /get-started/installation.

Notes

When to use it

An app's side navigation with the product's name, an optional search field, places in up to four groups of six and the signed-in person at the foot. Use app-sidebar-flat for one list.

Writing for it

- Give each group a heading, or leave it empty for the first group so its places show with none. - Make a group collapsible only when it holds rarely used places, and choose whether it starts open. - Write the search label as what is searched, and leave it empty to drop the field.

Watch out for

Collapsible groups hide places, so keep the places people use every day in a group that starts open. On a phone the whole sidebar folds into a menu.

Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import AppSidebarGrouped from '@/components/klarhimmel/blocks/app-sidebar-grouped';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <AppSidebarGrouped props={{
          "brand": "Name the product",
          "navLabel": "Main navigation",
          "search": "Search",
          "groups": [
            {
              "label": "",
              "collapsible": false,
              "open": true,
              "items": [
                {
                  "label": "First page",
                  "icon": "gauge",
                  "href": "#overview"
                },
                {
                  "label": "Second page",
                  "icon": "book",
                  "href": "#bookings"
                }
              ]
            },
            {
              "label": "Name the group",
              "collapsible": true,
              "open": true,
              "items": [
                {
                  "label": "Page three",
                  "icon": "users",
                  "href": "#team"
                },
                {
                  "label": "Fourth page",
                  "icon": "settings",
                  "href": "#settings"
                }
              ]
            }
          ],
          "active": "First page",
          "account": "Name the signed-in person"
        }} />
      </BlockSurface>
    </Theme>
  );
}

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.

PropTypeDefaultDescription
brandstring'Name the product'Text, up to 30 characters.
navLabelstring'Main navigation'Text, up to 40 characters.
searchstring'Search'Text, up to 30 characters.
groups{ label, collapsible, open, items }[]2 itemsList of 1 to 4. Each item: label, collapsible, open, items.
activestring'First page'Text, up to 30 characters.
accountstring'Name the signed-in person'Text, up to 40 characters.