Import Card Code Input and compose its parts.
card-code-input.tsx
CardCodeInput
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| rounded | "default""full" | "default" | |
| size | "default""lg""sm""xs" | "default" | |
| variant | "dashed""default" | — | |
| disabled | boolean | false | Turns the control off; the frame fades to 50% with it (the Base UI name). |
| read | boolean | false | The code shows and can be copied, but not changed (the Base UI name). |
| value | string | — | The shown code (controlled). |
| default | string | "" | The first shown code (uncontrolled). |
| on | — | Runs on every change with the digits and the checks. | |
| brand | null"amex""diners""discover""elo""hipercard""jcb""maestro""mastercard""mir""rupay""troy""unionpay""verve""visa" | null | The brand of the card number: Amex takes 4 digits, printed on the front. |
| length | 34 | — | A fixed length, when you do not know the brand. Wins over brand. |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
CardCodeInputControl
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| guide | boolean | — | The ghost guide of the slots still to fill, while the input has focus. Default true. |
| raw | string | — | Also submit the raw value under this name (a hidden input), next to the shown one. |
| reject | boolean | — | Nudge the field 2px when the mask rejects a key. Default true. |
| on | — | Runs when the mask rejects a key (a letter in a number, a 13th month). | |
| ref | Ref<HTMLInputElement> | — | |
| rounded | "default""full" | — | |
| size | "default""lg""sm""xs" | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>. |
CardCodeInputHint
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
Built with
Installs with Card Code Input
- Components
- Input Group,Masked Input













