Usage
The DashboardSearchButton component is used to open the DashboardSearch modal.
<template>
<UDashboardSearchButton />
</template>
It extends the Button component, so you can pass any property such as color
, variant
, size
, etc.
<template>
<UDashboardSearchButton label="Search..." variant="subtle" />
</template>
color="neutral"
and variant="outline"
.Kbds
Use the kbds
prop to display keyboard keys in the button. Defaults to ['meta', 'K']
to match the default shortcut of the DashboardSearch component.
<template>
<UDashboardSearchButton :kbds="['alt', 'O']" />
</template>
Collapsed
Use the collapsed
prop to collapse the button when the DashboardSidebar is collapsed.
<template>
<UDashboardSearchButton collapsed />
</template>
API
Props
Prop | Default | Type |
---|---|---|
as |
|
The element or component this component should render as when not a link. |
icon |
|
The icon displayed in the button. |
label |
|
The label displayed in the button. |
color |
|
|
variant |
|
|
size |
| |
collapsed |
|
Whether the button is collapsed. |
kbds |
|
The keyboard keys to display in the button.
|
disabled |
| |
ui |
|
Slots
Slot | Type |
---|---|
leading |
|
default |
|
trailing |
|
Theme
export default defineAppConfig({
uiPro: {
dashboardSearchButton: {
slots: {
base: '',
trailing: 'flex items-center gap-0.5 ms-auto'
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
dashboardSearchButton: {
slots: {
base: '',
trailing: 'flex items-center gap-0.5 ms-auto'
}
}
}
})
]
})