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>
<PDashboardSidebarToggle />
</template>
It extends the Button component, so you can pass any property such as color, variant, size, etc.
<template>
<PDashboardSidebarToggle 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>
<PDashboardGroup>
<PDashboardSidebar>
<template #toggle>
<PDashboardSidebarToggle variant="subtle" />
</template>
</PDashboardSidebar>
<slot />
</PDashboardGroup>
</template>
<script setup lang="ts">
definePageMeta({
layout: 'dashboard'
});
</script>
<template>
<PDashboardPanel>
<template #header>
<PDashboardNavbar title="Home">
<template #toggle>
<PDashboardSidebarToggle variant="subtle" />
</template>
</PDashboardNavbar>
</template>
</PDashboardPanel>
</template>
toggle-side prop of the DashboardSidebar and DashboardNavbar components, the button will be displayed on the specified side.| Prop | Default | Type |
|---|
Below is the theme configuration skeleton for the PDashboardSidebarToggle. Since the component is provided unstyled by default, you will need to fill in these values to apply your own custom look and feel. If you prefer to use our pre-built, opinionated styling, you can instead use our UnoCSS preset, this docs is using it as well.
export default defineAppConfig({
pohon: {
dashboardSidebarToggle: {
base: '',
variants: {
side: {
left: '',
right: ''
}
}
}
}
};
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import pohon from 'pohon-ui/vite'
export default defineAppConfig({
pohon: {
dashboardSidebarToggle: {
base: '',
variants: {
side: {
left: '',
right: ''
}
}
}
}
};