Components

Sidebar

Build a navigation drawer with rail (compact) and responsive mobile states.

UiSidebar is a navigation drawer composed from region sub-components. It tracks two independent states:

  • rail — compact, icons-only mode (a desktop concern). One-way; the parent controls it.
  • open — the responsive mobile slide-in. Supports v-model:open; on desktop the drawer is always visible.

Build a sidebar

<script setup lang="ts">
import { NuxtLink } from '#components'
import { ref } from 'vue'

const rail = ref(false) // compact (desktop)
const open = ref(false) // mobile drawer
</script>

<template>
  <UiSidebar bordered :rail="rail" v-model:open="open" aria-label="Main navigation">
    <UiSidebarHeader>
      <UiSidebarDropdown title="Acme" subtitle="Workspace" />
    </UiSidebarHeader>

    <UiSidebarBody>
      <UiSidebarText text="Platform" />
      <UiSidebarLink :as="NuxtLink" to="/" text="Home" icon="&#xe88a;" tooltip-text="Home" />
      <UiSidebarLink :as="NuxtLink" to="/projects" text="Projects" icon="&#xe8ef;" />

      <UiSidebarGroup text="Account" collapsible :default-open="true" icon="&#xe853;">
        <UiSidebarLink :as="NuxtLink" to="/account" text="Profile" icon="&#xe853;" child />
        <UiSidebarLink :as="NuxtLink" to="/notifications" text="Notifications" icon="&#xe7f4;" child />
      </UiSidebarGroup>
    </UiSidebarBody>

    <UiSidebarFooter>
      <UiBadge text="v1.0.0" variant="outline" size="sm" />
    </UiSidebarFooter>
  </UiSidebar>
</template>

Toggle the mobile drawer

Wire open to a toggle (e.g. in your navbar):

<template>
  <UiNavbarToggle :collapsed="open" @toggle="open = !open" />
</template>

UiSidebar props

PropTypeDefaultDescription
borderedbooleanfalseRight border instead of shadow.
railbooleanfalseCompact icons-only mode (one-way).
openbooleanfalseMobile open state (v-model:open).
widthstring | nullnullSets --theme-nav-drawer-width.
ariaLabelstring'Main navigation'Landmark name.

Emits: update:open.

Region & item components

ComponentKey props
UiSidebarHeader / UiSidebarBody / UiSidebarFootercustomClass
UiSidebarTexttext
UiSidebarLinkas, to / href, text, icon, tooltipText, tooltipPlacement, child, active, disabled
UiSidebarGrouptext, icon, collapsible, defaultOpen
UiSidebarDropdowntitle, subtitle, interactive, placement
Copyright © 2026