Search Input
Поисковая строка. Бесплатно, MIT · Формы и ввод › Текст
Установка
npx valyro-cli@latest add search-input
npx shadcn@latest add https://valyro.xyz/r/search-input.json
npm install valyro-ui
import 'valyro-ui/styles.css';
import { SearchInput } from 'valyro-ui';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
value | string | Controlled value; use with onValueChange. | |
defaultValue | string | Initial value when uncontrolled. | |
onValueChange | (value: string) => void | Called as the text changes — after debounce ms of no typing when set; clearing is reported immediately. | |
debounce | number | 0 | Quiet period before onValueChange fires, ms; 0 reports every keystroke. |
onSearch | (value: string) => void | Called on Enter with the current text. | |
shortcut | string | Keyboard hint shown in the field, e.g. "mod+k" (⌘K on Apple, Ctrl K elsewhere) or "/". | |
globalShortcut | boolean | false | Also focus the field when shortcut is pressed anywhere on the page. |
loading | boolean | false | Swaps the search icon for a spinner and sets aria-busy on the input. |
size | 'sm' | 'md' | 'lg' | Field height and text size. | |
rightIcon | ReactNode | Icon inside the field, after the text and the clear/password buttons. | |
invalid | boolean | Error border and aria-invalid on the input (an explicit aria-invalid wins). | |
labels | Partial<TextInputLabels> | Accessible names of the clear and show/hide password buttons. |
Похожие компоненты
- Text Input — Текстовые поля
- Textarea — Многострочный ввод
- Mentions Input — Текст с @упоминаниями и #тегами, асинхронные подсказки
- Tags Input — Ввод тегов
- Select — Выбор из списка
- Multi Select — Множественный выбор
- Combobox — Поиск и выбор
- Listbox — Список вариантов на странице: один или несколько, диапазоны с Shift
- Chip Group — Группа чипов с иконками: один или несколько вариантов
- Checkbox Tree — Дерево с чекбоксами: каскад, частичная отметка, клавиатура
- Checkbox — Флажки
- Checkbox Group — Флажки с общей подписью, подсказкой, ошибкой и обязательностью
Назад: Textarea · Далее: Mentions Input · Весь раздел «Формы и ввод»