Trên trang này

Trang này chưa có bản tiếng Việt, nội dung bên dưới là bản tiếng Anh. Xem trang tiếng Anh

Sidebar

Install, props and the parts Sidebar is built from.

Install

Run this in the app, after shadcn-vue init and the Beehexa theme (Button › Code):

npx shadcn-vue@latest add https://beehexa.design/r/sidebar.json

Use

<script setup lang="ts">
import { Sidebar, SidebarContent, SidebarGroup, SidebarGroupLabel, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarProvider } from '@/components/ui/sidebar'
</script>

<template>
  <div>
    <SidebarProvider>
      <Sidebar collapsible="icon">
        <SidebarContent>
          <SidebarGroup>
            <SidebarGroupLabel>Stores</SidebarGroupLabel>
            <SidebarMenu>
              <SidebarMenuItem><SidebarMenuButton :is-active="true">Orders</SidebarMenuButton></SidebarMenuItem>
            </SidebarMenu>
          </SidebarGroup>
        </SidebarContent>
      </Sidebar>
    </SidebarProvider>
  </div>
</template>

Props

Part Prop Values Notes
Sidebar side, variant, collapsible left/right, sidebar/floating/inset, offcanvas/icon/none
SidebarMenuButton is-active, tooltip boolean, string tooltip shows when collapsed

Built on

The shadcn-vue Sidebar: a SidebarProvider holding the open state, the Beehexa Sheet on phones, Tooltip for collapsed items.