DashboardSearchButton

ButtonGitHub
A pre-styled Button to open the DashboardSearch modal.

Usage

The DashboardSearchButton component is used to open the DashboardSearch modal.

<template>
  <PDashboardSearchButton />
</template>

It extends the Button component, so you can pass any property such as color, variant, size, etc.

<template>
  <PDashboardSearchButton variant="subtle" />
</template>
The button defaults to color="neutral" and variant="outline" when not collapsed, variant="ghost" when collapsed.

Collapsed

Use the collapsed prop to hide the button's label and kbds. Defaults to false.

<template>
  <PDashboardSearchButton collapsed />
</template>
When using the button in the DashboardSidebar component, use the collapsed slot prop directly.

Kbds

Use the kbds prop to display keyboard keys in the button. Defaults to ['meta', 'K'] to match the default shortcut of the DashboardSearch component.

<template>
  <PDashboardSearchButton :kbds="['alt', 'O']" />
</template>

API

Props

Prop Default Type
This component also supports all native <button> HTML attributes.

Slots

Slot Type

Theme

We use unocss-variants to customize the theme. Read more about it in the theming guide.

Below is the theme configuration skeleton for the PDashboardSearchButton. 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.

app.config.ts
export default defineAppConfig({
  pohon: {
    dashboardSearchButton: {
      slots: {
        base: '',
        label: '',
        trailing: ''
      },
      variants: {
        collapsed: {
          true: {
            label: '',
            trailing: ''
          }
        }
      }
    }
  }
};
vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import pohon from 'pohon-ui/vite'

export default defineAppConfig({
  pohon: {
    dashboardSearchButton: {
      slots: {
        base: '',
        label: '',
        trailing: ''
      },
      variants: {
        collapsed: {
          true: {
            label: '',
            trailing: ''
          }
        }
      }
    }
  }
};

Changelog

No recent changes