Layout

Sidebar

Navigation for apps: items with icons and counts, grouped under titles that fold away, and a footer pinned to the bottom.

Installation #

With the Nuxt module, every component is auto-imported — there is nothing to add. In a plain Vue project, import what you use:

Copy
import { JSidebar, JSidebarGroup, JSidebarItem } from '@juxtui/ui'

Usage #

Copy
<JSidebar>
  <JSidebarItem :as="NuxtLink" to="/" active>Overview</JSidebarItem>
  <JSidebarGroup title="Projects">
    <JSidebarItem :as="NuxtLink" to="/p/web">Website</JSidebarItem>
  </JSidebarGroup>
</JSidebar>

The sidebar takes the full height of its column. In a container with a fixed height (e.g. h-dvh) the item list scrolls inside it; in a page that only has a minimum height (e.g. min-h-screen) it stretches with the page. Either way the footer stays at the bottom.

On small screens, put the same sidebar inside a JSheet opened by a JBurger. See the app shell block.

Variants & examples #

API #

JSidebar

PropTypeDefault Description
labelstring'Sidebar'Accessible name of the navigation landmark.

Slots

SlotProps Description
header—Logo, workspace switcher.
default—Items and groups.
footer—Pinned to the bottom.

JSidebarGroup

PropTypeDefault Description
titlestring—Group heading.
collapsiblebooleantrueLet the heading fold the group away.
openbooleantrueExpanded state, optionally bound with v-model:open.

Slots

SlotProps Description
default—Items.

JSidebarItem

PropTypeDefault Description
activebooleanfalseCurrent page: highlighted with an accent marker and aria-current="page".
disabledbooleanfalseRemoved from the tab order and marked aria-disabled.
asstring | Component'a'Render as NuxtLink or any element.

Slots

SlotProps Description
default—Label, truncated with an ellipsis if too long.
leading—Icon.
trailing—Count, badge or shortcut.

Accessibility #

  • An <aside> with a labelled <nav> inside.
  • Group headings are buttons with aria-expanded; folded groups are inert, so hidden links can’t be reached.
  • The active item is announced with aria-current="page"; the accent marker is decoration on top.

Keyboard #

Key Action
TabMoves through items. Items in a folded group are skipped.
EnterOn a group heading: folds or unfolds the group.