Components
- Accordion
- Add to Cart
- Animated List
- Carousel
- Collapsible Sidebarnew
- Dynamic Island
- Expandable Cardnew
- Expanding Searchnew
- Filter Grid
- Kanban Board
- Layout Switcher
- Morphing Popover
- Number Flip
- Page Transition
- Product Gallery
- Segmented Control
- Sortable Table
- Stack Navigator
- Status Button
- Step Wizard
- Tabs
- Text Morphnew
- Theme Mode Switch
- Theme Morph Button
- Theme Toggle Button
- Theme Toggle Switch
- Theme Transition
- Toast Stacknew
Acme
Installation
$ pnpm dlx shadcn@latest add @transition-kit/expanding-searchUsage
import { ExpandingSearch } from "@/components/transitions/expanding-search";<ExpandingSearch
placeholder="Search docs…"
onSubmit={(query) => router.navigate({ to: "/search", search: { query } })}
/>The field takes focus when it opens. Escape clears the query, then closes the field; leaving an empty field closes it too.
API Reference
ExpandingSearch
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | - | Controlled query. |
defaultValue | string | "" | Initial query when uncontrolled. |
onValueChange | (value: string) => void | - | Called as the query changes. |
open | boolean | - | Controlled open state. |
defaultOpen | boolean | false | Initial open state when uncontrolled. |
onOpenChange | (open: boolean) => void | - | Called when the field opens or closes. |
onSubmit | (value: string) => void | - | Called when the user presses Enter. |
placeholder | string | "Search…" | Input placeholder. |
label | string | "Search" | Accessible name of the button and input. |
Change the corner radius with :root { --tk-ui-expanding-search-radius: 0.5rem; }.