Usage
The ContentSearchButton component is used to open the ContentSearch modal.
<template>
<B24ContentSearchButton />
</template>
It extends the Button component, so you can pass any property such as color, size, etc.
<template>
<B24ContentSearchButton color="air-primary" />
</template>
The button defaults to
color="air-secondary-no-accent" when not collapsed, color="air-tertiary-no-accent" when collapsed.Collapsed
Use the collapsed prop to show the button's label and kbds. Defaults to true.
<template>
<B24ContentSearchButton :collapsed="false" />
</template>
Kbds
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>
<B24ContentSearchButton
:collapsed="false"
:kbds="{
'0': 'alt',
'1': 'O'
}"
/>
</template>
API
Props
Slots
Theme
app.config.ts
export default defineAppConfig({
b24ui: {
contentSearchButton: {
slots: {
base: '',
baseLine: '',
label: '',
trailing: 'hidden lg:flex items-center gap-0.5 ms-auto'
},
variants: {
collapsed: {
true: {
baseLine: 'ps-[5px] pe-[5px]',
label: 'hidden',
trailing: 'lg:hidden'
}
}
}
}
}
})
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: {
contentSearchButton: {
slots: {
base: '',
baseLine: '',
label: '',
trailing: 'hidden lg:flex items-center gap-0.5 ms-auto'
},
variants: {
collapsed: {
true: {
baseLine: 'ps-[5px] pe-[5px]',
label: 'hidden',
trailing: 'lg:hidden'
}
}
}
}
}
})
]
})