uibrik

Search

Preview

Customize

Max width560px
Search delay500ms
Recents3

Usage

import { SearchPalette } from "@/components/uibrik/search/SearchPalette";

<SearchPalette />

Installation

npx shadcn@latest add https://uibrik.com/r/search.json
Adds the files to components/uibrik/search and installs @tabler/icons-react and motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/search.

Props

SearchPalette
placeholder
Type string
"Search"
Text on the closed pill and in the empty field.
maxWidth
Type number
560
Widest the open palette gets.
searchDelay
Type number
500
Wait before results show.
shortcut
Type string
"k"
Key that toggles it with ⌘ / Ctrl. Empty disables.
maxRecents
Type number
3
Recent searches kept.
items
Type SearchItem[]
SAMPLE_SEARCH_ITEMS
Searchable items: id, title, scope, type and date.
onSelect
Type (item: SearchItem) => void
–
Called when a result is picked.
recentsKey
Type string
"search-19-recents"
localStorage key for recent searches.
className
Type string
–
Classes for the wrapper.