Skip to content

DocsNavigationSidebar

PT

Navigation

Sidebar

App navigation with a user, search, active item with a counter and a team footer.

data-u="nav"

Example

Installation

Sidebar ships in the full package, in unslop.css and unslop.js:

curl -fsSL unslop.leallabs.dev/i | sh

A ready-made block that uses sidebar:

curl -fsSL unslop.leallabs.dev/i | sh -s add wall-sidebar

No build Name-based add is for charts and blocks. Components with JS live in unslop.js, which mounts every data-u on the page by itself.

Props

No props. The nav registration moves aria-current to the clicked item.

Classes and variants

ClassWhat it does
u-sideThe sidebar's nav.
u-side__userUser row.
u-side__navItem list.
u-side__itemItem: button or a. The active one has aria-current="page".
u-side__spacerPushes the footer down.

Accessibility and keyboard

State and roles

WhereAttributeWhat it says
navaria-labelName the navigation.
active itemaria-current="page"The JS switches it on click. A link with href="#" doesn't navigate.

Keyboard

KeyDoes
Tabmoves through the items
Enteractivates the item

Type to search. Arrows pick, Enter opens.