ContentSearchButton

A pre-styled Button to open the ContentSearch modal.
This component is only available when the @nuxt/content module is installed.

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 label="Search..." variant="subtle" />
</template>
The button defaults to color="neutral" and variant="ghost".

API

Props

Prop Default Type
as

'button'

any

The element or component this component should render as when not a link.

icon

appConfig.ui.icons.search

string

The icon displayed in the button.

label

string

color

'neutral'

"error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral"

variant

'ghost'

"link" | "solid" | "outline" | "soft" | "subtle" | "ghost"

size

"md" | "xs" | "sm" | "lg" | "xl"

disabled

boolean

ui

PartialString<{ base: string[]; label: string; leadingIcon: string; leadingAvatar: string; leadingAvatarSize: string; trailingIcon: string; }>

Slots

Slot Type
leading

{}

default

{}

trailing

{}

Theme

app.config.ts
export default defineAppConfig({
  uiPro: {
    contentSearchButton: {
      base: ''
    }
  }
})
vite.config.ts
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: ''
        }
      }
    })
  ]
})