Skip to content

SidebarSection

A heading over a few items of the sidebar: «Data», «Access». It groups the places by what the person does there.

import { SidebarSection } from '@sypnia/ui/react'

On this page
  1. Sections of a sidebar
  2. When to use it
  3. For everyone
  4. Props

Sections of a sidebar

Code
import { NavGroup, NavItem, Sidebar, SidebarSection } from '@sypnia/ui/react';

// The side navigation on its own, for apps with their own frame. AppShell draws the same thing from `nav`.
export default function Data() {
  return (
    <Sidebar foot={<NavItem href="#account" icon="user" label="Account" />}>
      <SidebarSection>
        <NavItem href="#overview" icon="home" label="Overview" />
        <NavItem href="#tables" icon="table" label="Tables" current />
        <NavItem href="#sql" icon="query" label="SQL" />
      </SidebarSection>
      <SidebarSection title="Access">
        <NavItem href="#users" icon="users" label="Users" badge="3" />
        <NavItem href="#keys" icon="key" label="API keys" />
        <NavGroup icon="logs" label="Logs"><NavItem href="#api" icon="api" label="API" /><NavItem href="#auth" icon="lock" label="Sign-ins" /></NavGroup>
      </SidebarSection>
    </Sidebar>
  );
}

When to use it

Use it when

  • Five or more items that fall into clear groups.
  • Short headings, one or two words.

Do not use it when

  • One section with a heading: no heading is needed.
  • Headings that repeat the item names.

For everyone

  • The heading is text, not a landmark: the whole sidebar is one navigation.

Props

SidebarSectionTypeDefault
title string
  1. Sections of a sidebar
  2. When to use it
  3. For everyone
  4. Props

    Search pages, sections and terms