The ContentSearchButton component is used to open the ContentSearch modal.
<template>
<PContentSearchButton />
</template>
It extends the Button component, so you can pass any property such as color, variant, size, etc.
<template>
<PContentSearchButton variant="subtle" />
</template>
color="neutral" and variant="outline" when not collapsed, variant="ghost" when collapsed.Use the collapsed prop to show the button's label and kbds. Defaults to true.
<template>
<PContentSearchButton />
</template>
Use the kbds prop to display keyboard keys in the button. Defaults to ['meta', 'K'] to match the default shortcut of the ContentSearch component.
<template>
<PContentSearchButton :kbds="['alt', 'O']" />
</template>
| Prop | Default | Type |
|---|
| Slot | Type |
|---|
Below is the theme configuration skeleton for the PContentSearchButton. 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: {
contentSearchButton: {
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: {
contentSearchButton: {
slots: {
base: '',
label: '',
trailing: ''
},
variants: {
collapsed: {
true: {
label: '',
trailing: ''
}
}
}
}
}
};