iOS-style Search Bar

A minimalist search pill that smoothly expands on focus and reveals quick-clear controls with spring animation.

Focus pill to test spring expansion (or press ⌘K)

Installation

Add the component directly to your repository using shadcn CLI:

npx shadcn@latest add Surajmaurya1/easyui/ios-search-bar

API Reference

PropTypeDefaultDescription
valuestringCurrent search query string
onChange(value: string) => voidInput change handler
onSubmit(value: string) => voidundefinedFired when Enter is pressed
onClear() => voidundefinedCallback when clear button is clicked
placeholderstring'Search...'Placeholder label
collapsedWidthnumber | string'220px'Width before focus
expandedWidthnumber | string'340px'Width after focus