The DashboardSearchButton component is used to open the DashboardSearch modal.
<template>
<PDashboardSearchButton />
</template>
It extends the Button component, so you can pass any property such as color, variant, size, etc.
<template>
<PDashboardSearchButton variant="subtle" />
</template>
color="neutral" and variant="outline" when not collapsed, variant="ghost" when collapsed.Use the collapsed prop to hide the button's label and kbds. Defaults to false.
<template>
<PDashboardSearchButton collapsed />
</template>
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>
<PDashboardSearchButton :kbds="['alt', 'O']" />
</template>
| Prop | Default | Type |
|---|
| Slot | Type |
|---|
Below is the theme configuration skeleton for the PDashboardSearchButton. 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: {
dashboardSearchButton: {
slots: {
base: '',
label: '',
trailing: ''
},
variants: {
collapsed: {
true: {
label: '',
trailing: ''
}
}
}
}
}
};
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import pohon from 'pohon-ui/vite'
export default defineAppConfig({
pohon: {
dashboardSearchButton: {
slots: {
base: '',
label: '',
trailing: ''
},
variants: {
collapsed: {
true: {
label: '',
trailing: ''
}
}
}
}
}
};