ValyroUI Русская версия

Card Input

Number, expiry and CVC in one field: masks, Luhn check, auto-advance. Pro · Shop and payments › Payments and wallet

Installation

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

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

Props

PropTypeDefault
valueCardInputValueThe three parts as raw digits (controlled).
defaultValueCardInputValueInitial value when uncontrolled.
onValueChange(value: CardInputValue, details: CardInputDetails) => voidCalled with the new value when it changes.
size'sm' | 'md' | 'lg''md'Field height. Default md.
invalidbooleanfalseMarks the whole field invalid (e.g. a declined card); finished parts that fail their check are marked on their own.
disabledbooleanfalseDisables all three parts.
namestringPrefix of the inputs' names: <name>-number, <name>-expiry, <name>-cvc.
labelsPartial<CardInputLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Credit Card · Next: Payment Methods · All Shop and payments