Search Input
A search field with a keyboard shortcut cap that becomes a clear button once there is text.
Customize
Escape clears, a second Escape leaves. While loading, the icon turns into a ring with one accent arc. The demo filters the months with a short simulated delay; rows that leave collapse.
Install
npx shadcn@latest add https://obsydeui.com/r/search-input.jsonUsage
Import it from where the CLI puts it, or copy the files below by hand.
import { SearchInput } from '@/components/obsyde/ember/search-input/SearchInput';
export function Example() {
return (
<SearchInput placeholder="Search" shortcut="/" />
);
}
Files
Plain React, TypeScript and CSS. No dependencies. The download keeps these paths.
ember/search-input/SearchInput.tsxcomponentember/search-input/search-input-demo.cssstylesember/search-input/search-input.cssstylesember/search-input/SearchInputDemo.tsxdemoember/shared/rolling-number.csssharedember/shared/RollingNumber.tsxsharedember/shared/spring.tssharedember/shared/accent.tssharedember/forms-kit/kit.tsxsharedember/shared/ember.cssshared
API
| Prop | Type | Default |
|---|---|---|
accentAccent | 'ember' | 'volt' | 'arc' | 'ember' |
valueQuery | string | — |
placeholderPlaceholder | string | 'Search' |
shortcutShortcut | string | '/' |
loadingLoading | boolean | false |