Nuxt UI Pro v1.0 is out with dashboard components! Discount ends in 7 hours.

ContentSearchButton

A pre-styled Button to open the ContentSearch modal.

This component is only available when the @nuxt/content module is installed.

Usage

The Button is already styled and will render as an icon button if you unset the label. You can override all the Button props as it's the root component.

<template>
  <UContentSearchButton label="Search..." />
</template>

You can also do this by yourself using the useUIState composable:

<script setup lang="ts">
const { toggleDocsSearch, isDocsSearchModalOpen } = useUIState()
</script>

<template>
  <UButton label="Open" @click="toggleDocsSearch" />
</template>

Props

label
string
"Search..."