# App sidebar, grouped

- **[Sections](/blocks/)**
- **[Application](/blocks/app/)**
- **App sidebar, grouped**

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

- **CLI**

  ```
  npx shadcn add https://ui.klarhimmel.com/r/app-sidebar-grouped.json
  ```
- **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.

## Pairs well with

- **[App, sidebar navigation](/blocks/app/shell-sidebar)**
- **[App, data table](/blocks/app/data-table)**
- **[App, top bar](/blocks/app/shell-topbar)**

## 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.

- **brand**: Text, up to 30 characters.
- **navLabel**: Text, up to 40 characters.
- **search**: Text, up to 30 characters.
- **groups**: List of 1 to 4. Each item: label, collapsible, open, items.
- **active**: Text, up to 30 characters.
- **account**: Text, up to 40 characters.

[Previous](/blocks/app/sidebar-flat)

[Next](/blocks/app/sidebar-rail)
