DashboardToolbar

GitHub
A toolbar to display under the navbar in a dashboard.

Usage

The DashboardToolbar component is used to display a toolbar under the DashboardNavbar component.

Use it inside the header slot of the DashboardPanel component:

pages/index.vue
<script setup lang="ts">
definePageMeta({
  layout: 'dashboard'
});
</script>

<template>
  <PDashboardPanel>
    <template #header>
      <PDashboardNavbar />

      <PDashboardToolbar />
    </template>
  </PDashboardPanel>
</template>

Use the left, default and right slots to customize the toolbar.

<script setup lang="ts">
import type { PNavigationMenuItem } from 'pohon-ui'

const items: Array<Array<PNavigationMenuItem>> = [
  [
    {
      label: 'General',
      icon: 'i-lucide:user',
      active: true
    },
    {
      label: 'Members',
      icon: 'i-lucide:users'
    },
    {
      label: 'Notifications',
      icon: 'i-lucide:bell'
    }
  ],
  [
    {
      label: 'Documentation',
      icon: 'i-lucide:book-open',
      to: 'https://akar.vinicunca.dev/docs',
      target: '_blank'
    },
    {
      label: 'Help & Feedback',
      icon: 'i-lucide:help-circle',
      to: 'https://github.com/vinicunca/akar/issues',
      target: '_blank'
    }
  ]
]
</script>

<template>
  <PDashboardToolbar>
    <PNavigationMenu :items="items" highlight class="flex-1" />
  </PDashboardToolbar>
</template>
In this example, we use the NavigationMenu component to render some links.

API

Props

Prop Default Type

Slots

Slot Type

Theme

We use unocss-variants to customize the theme. Read more about it in the theming guide.

Below is the theme configuration skeleton for the PDashboardToolbar. 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.

app.config.ts
export default defineAppConfig({
  pohon: {
    dashboardToolbar: {
      slots: {
        root: '',
        left: '',
        right: ''
      }
    }
  }
};
vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import pohon from 'pohon-ui/vite'

export default defineAppConfig({
  pohon: {
    dashboardToolbar: {
      slots: {
        root: '',
        left: '',
        right: ''
      }
    }
  }
};

Changelog

No recent changes