Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Morphing Search

Chip Search

MorphingSearchChips.vue

Install

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/morphing-search-chips

Import the shared styles once in your application.

TSUsage
import MorphingSearchChips from '@/components/beui/blocks/MorphingSearchChips.vue'
import '@/components/beui/styles.css'

API Reference

v-model:chips?
string[]

Active filters shown as chips inside the bar.

Default—
defaultChips?
string[]
Default[]
v-model:query?
string

Text in the field.

Default—
defaultQuery?
string
Default
v-model:recents?
string[]

Recent searches, newest first.

Default—
defaultRecents?
string[]
Default[]
storageKey?
string

Persist uncontrolled recents in localStorage under this key.

Default—
maxRecents?
number

How many recent searches to keep.

Default5
suggestions?
string[]

Terms offered while typing.

Default[]
filter?
((term: string, query: string) => boolean) | false

How suggestions match the query. Default: case-insensitive substring. Pass `false` when `suggestions` already arrive filtered, e.g. from a server.

Defaultundefined
maxSuggestions?
number

How many matches to list under the typed query.

Default6
loading?
boolean

Suggestions are being fetched.

Defaultfalse
maxChips?
number

Most chips allowed at once.

Default—
normalize?
(term: string) => string | null

Clean a term before it becomes a chip; return null to reject it.

Default—
emptyState?
string

Shown when the field is empty and there are no recent searches.

Default—
side?
Side | "auto"

Which way the surface grows. "auto" grows up unless there is no room.

Defaulttop
v-model:open?
boolean
Defaultundefined
defaultOpen?
boolean
Defaultfalse
disabled?
boolean
Defaultfalse
name?
string

Submit each chip with a form under this name.

Default—
placeholder?
string
Default—
label?
string

Accessible name for the search field.

Default—
#actions?
slot

Trailing controls inside the bar, such as filter buttons.

Default—
className?
string
Default—
labels?
Partial<typeof morphingSearchChipsMessages>

Override any built-in string.

Default—
@chips-change?
(chips: string[]) => void
Default—
@query-change?
(query: string) => void
Default—
@recents-change?
(recents: string[]) => void
Default—
@open-change?
(open: boolean) => void
Default—
@search?
(query: string, chips: string[]) => void

Emitted on Enter when no suggestion is highlighted.

Default—
#empty?
slot
Default—

Morphing Search

MorphingSearch.vue

Install

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/morphing-search

Import the shared styles once in your application.

TSUsage
import MorphingSearch from '@/components/beui/blocks/MorphingSearch.vue'
import '@/components/beui/styles.css'

API Reference

items
readonly MorphingSearchItem[]
Default—
placeholder?
string
Default—
shortcut?
string

Single key that opens the search from anywhere outside a field. Pass an empty string for none.

Defaultf
iconOnly?
boolean

Render the closed trigger as a compact search icon.

Defaultfalse
emptyMessage?
string
Default—
v-model:open?
boolean
Defaultundefined
defaultOpen?
boolean
Defaultfalse
@query-change?
(query: string) => void
Default—
@select?
(item: MorphingSearchItem) => void
Default—
labels?
Partial<typeof morphingSearchMessages>

Override any built-in string.

Default—
className?
string
Default—
@open-change?
(value: boolean) => void
Default—
#icon?
{ item: MorphingSearchItem }

Replaces a row's leading icon.

Default—
#item?
{ item: MorphingSearchItem; active: boolean; index: number }

Replaces a row's title and description.

Default—

Updated