Skip to content

SideNav

The navigation of a docs site: sections that fold, and a light beside the page you are on.

import SideNav from '@sypnia/ui/astro/SideNav.astro'

On this page
  1. Sections
  2. Skeleton
  3. When to use it
  4. For everyone

Sections

A section that holds the current page starts open. collapsible: false shows a section as a plain list; planned marks a page that is not written yet; count adds a number.

Code
---
import SideNav from '@sypnia/ui/astro/SideNav.astro';
const sections = [
  { title: 'Get started', items: [{ label: 'What Sypnia Data is', href: '/docs' }, { label: 'Quickstart', href: '/docs/quickstart' }] },
  { title: 'Guides', items: [{ label: 'Import a CSV', href: '/docs/csv' }, { label: 'Invite your team', href: '/docs/team' }, { label: 'Webhooks', href: '/docs/webhooks', planned: true }] },
  { title: 'Reference', collapsible: false, items: [{ label: 'API', href: '/docs/api', count: 42 }, { label: 'CLI', href: '/docs/cli' }] },
];
---
<div style="max-width:15rem"><SideNav sections={sections} current="/docs/quickstart" /></div>

Skeleton

SideNavSkeleton: section titles and their pages, as bars.

Code
---
import SideNavSkeleton from '@sypnia/ui/astro/SideNavSkeleton.astro';
---
<div style="max-width:15rem"><SideNavSkeleton sections={2} items={3} /></div>

When to use it

Use it when

  • More than a handful of pages, grouped in sections.

Do not use it when

  • Five pages or fewer: put them in the header.
  • An app's navigation: that is AppShell's sidebar.

For everyone

  • Sections are native disclosures: Enter or Space opens and closes them, without JavaScript.
  • The current page is marked aria-current="page", not only by the light.
  1. Sections
  2. Skeleton
  3. When to use it
  4. For everyone

    Search pages, sections and terms