ValyroUI English version

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';

Пропсы

PropTypeDefault
valuestringControlled value; use with onValueChange.
defaultValuestringInitial value when uncontrolled.
onValueChange(value: string) => voidCalled as the text changes — after debounce ms of no typing when set; clearing is reported immediately.
debouncenumber0Quiet period before onValueChange fires, ms; 0 reports every keystroke.
onSearch(value: string) => voidCalled on Enter with the current text.
shortcutstringKeyboard hint shown in the field, e.g. "mod+k" (⌘K on Apple, Ctrl K elsewhere) or "/".
globalShortcutbooleanfalseAlso focus the field when shortcut is pressed anywhere on the page.
loadingbooleanfalseSwaps the search icon for a spinner and sets aria-busy on the input.
size'sm' | 'md' | 'lg'Field height and text size.
rightIconReactNodeIcon inside the field, after the text and the clear/password buttons.
invalidbooleanError border and aria-invalid on the input (an explicit aria-invalid wins).
labelsPartial<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 · Весь раздел «Формы и ввод»