ValyroUI English version

Masked Input

Ввод по маске: карты с Luhn, срок действия, CVC, дата, время. Pro · Формы и ввод › Числа, коды и маски

Установка

npx valyro-cli@latest login
npx valyro-cli@latest add masked-input
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { MaskedInput } from 'valyro-ui-pro';

Пропсы

PropTypeDefault
mask *MaskPreset | string | MaskDefinitionA preset (card, expiry, cvc, date, time), a pattern (9 digit, a letter, * either, \ escapes, anything else is a literal), or a full MaskDefinition.
valuestringRaw value: the typed characters without the literals.
defaultValuestring''Initial value when uncontrolled.
onValueChange(value: string, details: MaskedInputDetails) => voidCalled with the new value when it changes.
showCardBrandbooleantrueShow the detected card network at the end of card-number fields (default true).
size'sm' | 'md' | 'lg'Field height and text size.
leftIconReactNodeIcon inside the field, before the text.
rightIconReactNodeIcon inside the field, after the text and the clear/password buttons.
prefixReactNodeAttached text before the input, e.g. "https://".
suffixReactNodeAttached text after the input, e.g. ".vercel.app".
invalidbooleanError border and aria-invalid on the input (an explicit aria-invalid wins).
clearablebooleanShows a clear button while the input has a value.
labelsPartial<TextInputLabels>Accessible names of the clear and show/hide password buttons.

Похожие компоненты

  • Number Input — Числовой ввод
  • OTP Input — Ввод одноразового кода
  • Phone Input — Телефон с выбором страны, форматированием на лету и значением E.164
  • Text Input — Текстовые поля
  • Textarea — Многострочный ввод
  • Search Input — Поисковая строка
  • Mentions Input — Текст с @упоминаниями и #тегами, асинхронные подсказки
  • Tags Input — Ввод тегов
  • Select — Выбор из списка
  • Multi Select — Множественный выбор
  • Combobox — Поиск и выбор
  • Listbox — Список вариантов на странице: один или несколько, диапазоны с Shift

Назад: Phone Input · Далее: Date Picker · Весь раздел «Формы и ввод»