Morphing Search

Chip Search

morphing-search-chips.tsx

Install

$ bunx --bun shadcn add @beui/morphing-search-chips

API Reference

chips?
string[]

Active filters shown as chips inside the bar.

Default—
defaultChips?
string[]
Default[]
onChipsChange?
((chips: string[]) => void)
Default—
query?
string

Text in the field.

Default—
defaultQuery?
string
Default
onQueryChange?
((query: string) => void)
Default—
recents?
string[]

Recent searches, newest first.

Default—
defaultRecents?
string[]
Default[]
onRecentsChange?
((recents: string[]) => void)
Default—
storageKey?
string

Persist uncontrolled recents in localStorage under this key.

Default—
maxRecents?
number

How many recent searches to keep. Default 5.

Default5
suggestions?
string[]

Terms offered while typing.

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

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

Default—
maxSuggestions?
number

How many matches to list under the typed query. Default 6.

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?
ReactNode

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

Default—
side?
"auto" | "top" | "bottom"

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

Defaulttop
open?
boolean
Default—
defaultOpen?
boolean
Defaultfalse
onOpenChange?
((open: boolean) => void)
Default—
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?
ReactNode

Trailing controls inside the bar, such as filter buttons.

Default—
className?
string
Default—
labels?
Partial<{ placeholder: string; label: string; suggestions: string; recent: string; recentSearches: string; clear: string; searching: string; removeFilter: string; hint: string; filterLimit: string; ... 4 more ...; filterMarked: string; }>

Override any built-in string.

Default—

Morphing Search

morphing-search.tsx

Install

$ bunx --bun shadcn add @beui/morphing-search

API Reference

items
MorphingSearchItem[]
Default—
placeholder?
string
Default—
shortcut?
string
Defaultf
iconOnly?
boolean

Render the closed trigger as a compact search icon.

Defaultfalse
emptyMessage?
string
Default—
open?
boolean
Default—
defaultOpen?
boolean
Defaultfalse
onOpenChange?
((open: boolean) => void)
Default—
onQueryChange?
((query: string) => void)
Default—
onSelect?
((item: MorphingSearchItem) => void)
Default—
labels?
Partial<{ placeholder: string; empty: string; close: string; dialog: string; results: string; }>

Override any built-in string.

Default—
className?
string
Default—

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.

Updated