Usage
The ContentSearchButton component is used to open the ContentSearch modal.
<template>
<UContentSearchButton />
</template>
It extends the Button component, so you can pass any property such as color
, variant
, size
, etc.
<template>
<UContentSearchButton variant="subtle" />
</template>
color="neutral"
and variant="outline"
when not collapsed, variant="ghost"
when collapsed.Collapsed
Use the collapsed
prop to show the button's label and kbds. Defaults to true
.
<template>
<UContentSearchButton />
</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>
<UContentSearchButton :kbds="['alt', 'O']" />
</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 |
| |
color |
|
|
variant |
|
|
size |
|
|
disabled |
| |
ui |
|
Slots
Slot | Type |
---|---|
leading |
|
default |
|
trailing |
|
Theme
export default defineAppConfig({
uiPro: {
contentSearchButton: {
base: ''
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
uiPro: {
contentSearchButton: {
base: ''
}
}
})
]
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import uiPro from '@nuxt/ui-pro/vite'
export default defineConfig({
plugins: [
vue(),
uiPro({
uiPro: {
contentSearchButton: {
base: ''
}
}
})
]
})