Usage
The DashboardNavbar component is a responsive navigation bar that integrates with the DashboardSidebar component. It includes a mobile toggle button to enable responsive navigation in dashboard layouts.
Use it inside the header slot of the DashboardPanel component:
pages/index.vue
<script setup lang="ts">
definePageMeta({
layout: 'dashboard'
})
</script>
<template>
<B24DashboardPanel>
<template #header>
<B24DashboardNavbar />
</template>
</B24DashboardPanel>
</template>
Use the left, default and right slots to customize the navbar.
Inbox
4Title
Use the title prop to set the title of the navbar.
Dashboard
<template>
<B24DashboardNavbar title="Dashboard" />
</template>
Icon
Use the icon prop to set the icon of the navbar.
Dashboard
<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'
</script>
<template>
<B24DashboardNavbar title="Dashboard" :icon="RocketIcon" />
</template>
Toggle
Use the toggle prop to customize the toggle button displayed on mobile that opens the DashboardSidebar component.
You can pass any property from the Button component to customize it.
Toggle Side
Use the toggle-side prop to change the side of the toggle button. Defaults to left.
API
Props
Slots
Theme
app.config.ts
export default defineAppConfig({
b24ui: {
dashboardNavbar: {
slots: {
root: 'h-(--b24ui-header-height) shrink-0 flex items-center justify-between border-b border-(--ui-color-divider-default) px-4 gap-1.5',
left: 'flex items-center gap-1.5 min-w-0',
icon: 'shrink-0 size-5 self-center me-1.5',
title: 'flex items-center gap-1.5 font-(--ui-font-weight-semi-bold) text-(--b24ui-typography-label-color) truncate',
center: 'hidden lg:flex',
right: 'flex items-center shrink-0 gap-1.5',
toggle: ''
},
variants: {
toggleSide: {
left: {
toggle: ''
},
right: {
toggle: ''
}
}
}
}
}
})
vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import bitrix24UIPluginVite from '@bitrix24/b24ui-nuxt/vite'
export default defineConfig({
plugins: [
vue(),
bitrix24UIPluginVite({
b24ui: {
dashboardNavbar: {
slots: {
root: 'h-(--b24ui-header-height) shrink-0 flex items-center justify-between border-b border-(--ui-color-divider-default) px-4 gap-1.5',
left: 'flex items-center gap-1.5 min-w-0',
icon: 'shrink-0 size-5 self-center me-1.5',
title: 'flex items-center gap-1.5 font-(--ui-font-weight-semi-bold) text-(--b24ui-typography-label-color) truncate',
center: 'hidden lg:flex',
right: 'flex items-center shrink-0 gap-1.5',
toggle: ''
},
variants: {
toggleSide: {
left: {
toggle: ''
},
right: {
toggle: ''
}
}
}
}
}
})
]
})