The DashboardSidebarToggle component is used by the DashboardNavbar and DashboardSidebar components.
It is automatically displayed on mobile to toggle the sidebar, you don't have to add it manually.
<template>
  <UDashboardSidebarToggle />
</template>
It extends the Button component, so you can pass any property such as color, variant, size, etc.
<template>
  <UDashboardSidebarToggle variant="subtle" />
</template>
color="neutral" and variant="ghost".toggle slotEven though this component is automatically displayed on mobile, you can use the toggle slot of the DashboardNavbar and DashboardSidebar components to customize the button.
<template>
  <UDashboardGroup>
    <UDashboardSidebar>
      <template #toggle>
        <UDashboardSidebarToggle variant="subtle" />
      </template>
    </UDashboardSidebar>
    <slot />
  </UDashboardGroup>
</template>
<script setup lang="ts">
definePageMeta({
  layout: 'dashboard'
})
</script>
<template>
  <UDashboardPanel>
    <template #header>
      <UDashboardNavbar title="Home">
        <template #toggle>
          <UDashboardSidebarToggle variant="subtle" />
        </template>
      </UDashboardNavbar>
    </template>
  </UDashboardPanel>
</template>
toggle-side prop of the DashboardSidebar and DashboardNavbar components, the button will be displayed on the specified side.| Prop | Default | Type | 
|---|---|---|
as | 
 The element or component this component should render as when not a link.  | |
color | 
  | |
variant | 
  | 
  | 
side | 
  | 
 The side of the sidebar to toggle.  | 
name | 
  | |
form | 
  | |
label | 
  | |
to | 
 Route Location the link should navigate to when clicked on. 
  | |
target | 
 Where to display the linked URL, as the name for a browsing context.  | |
trailingSlash | 
 An option to either add or remove trailing slashes in the   | |
autofocus | 
  | |
disabled | 
  | |
formaction | 
  | |
formenctype | 
  | |
formmethod | 
  | |
formnovalidate | 
  | |
formtarget | 
  | |
type | 
  | 
 The type of the button when not a link.  | 
value | 
  | |
download | 
  | |
hreflang | 
  | |
media | 
  | |
ping | 
  | |
referrerpolicy | 
  | |
active | 
 Force the link to be active independent of the current route.  | |
activeColor | 
  | |
activeVariant | 
  | |
size | 
  | 
  | 
square | 
 Render the button with equal padding on all sides.  | |
block | 
 Render the button full width.  | |
loadingAuto | 
 Set loading state automatically based on the   | |
icon | 
 Display an icon based on the   | |
avatar | 
 Display an avatar on the left side. 
  | |
leading | 
 When   | |
leadingIcon | 
 Display an icon on the left side.  | |
trailing | 
 When   | |
trailingIcon | 
 Display an icon on the right side.  | |
loading | 
 When   | |
loadingIcon | 
  | 
 The icon when the   | 
ui | 
  | 
export default defineAppConfig({
  ui: {
    dashboardSidebarToggle: {
      base: 'lg:hidden',
      variants: {
        side: {
          left: '',
          right: ''
        }
      }
    }
  }
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
  plugins: [
    vue(),
    ui({
      ui: {
        dashboardSidebarToggle: {
          base: 'lg:hidden',
          variants: {
            side: {
              left: '',
              right: ''
            }
          }
        }
      }
    })
  ]
})
5cb65 — feat: import @nuxt/ui-pro components