XiodUI
HomeDocs
OverviewComponentsStyling & CustomizationChangelog

Components

  • Accordion
  • Agent Steps
  • Alert
  • Alert Dialog
  • Aspect Ratio
  • Autocomplete
  • Avatar
  • Badge
  • Breadcrumb
  • Button
  • Button Group
  • Button Split
  • Calendar
  • Card
  • Carousel
  • Checkbox
  • Circular Progress
  • Collapsible
  • Color Picker
  • Combobox
  • Command
  • Context Menu
  • Copy To Clipboard
  • Corner Badge
  • Dashboard Grid
  • Date Picker
  • Dialog
  • Dot Matrix
  • Draggable
    Updated
  • Drawer
  • Empty
  • Field
  • Fieldset
  • File Upload
    Updated
  • Form
  • Frame
  • Gauge
  • Grid
  • Group
  • Input
  • Input Group
  • Input OTP
  • Input Payment
  • Input Phone
    Updated
  • Input Sensitive
  • Kbd
  • Kinetic Click
  • Label
  • List Box
    Updated
  • Loader
  • Marker
  • Menu
  • Menubar
  • Message
  • Meter
  • Morphic Toast
  • Navigation Menu
  • Number Field
  • Option Picker
  • Orb
  • Pagination
  • Popover
  • Preview Card
    Updated
  • Progress
  • Radio
  • Resizable
  • Ruler Picker
  • Scroll Area
  • Scroll Bar
  • Select
  • Separator
  • Sidebar
  • Skeleton
  • Slider
  • Sortable
  • Switch
  • Table
  • Tabs
  • Text
  • Textarea
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Toolbar
  • Tooltip
  • Waveform
  • Wheel Picker

Loading...

Preview Skeleton

Installation Skeleton

Usage Skeleton

API Reference Skeleton

Sponsors

Support the development of XiodUI and help us build the best component library on Earth.

+++
Sponsor on GitHub

Input Payment

Previous: Input OTPNext: Input Phone

Card number, expiry and security code inputs with formatting and card brand detection.

Preview

Loading Preview...

Installation

bun add xiod-ui

Usage

Imports

1import {2  InputPayment,3  InputPaymentBrandIcon,4  InputPaymentCVC,5  InputPaymentCardNumber,6  InputPaymentExpiry,7  InputPaymentGroup,8  InputPaymentMethodSelector,9  InputPaymentUpiGroup,10  InputPaymentUpiId,11  InputPaymentUpiProviderIcon,12  InputPaymentZip13} from "xiod-ui/input-payment";

Anatomy

1<InputPaymentMethodSelector />2<InputPaymentGroup>3  <InputPaymentBrandIcon />4  <InputPaymentCardNumber />5  <InputPaymentExpiry />6  <InputPaymentCVC />7</InputPaymentGroup>8<InputPaymentUpiGroup>9  <InputPaymentUpiProviderIcon />10  <InputPaymentUpiId />11</InputPaymentUpiGroup>12<InputPayment>13  <InputPaymentCardNumber />14  <InputPaymentBrandIcon />15  <InputPaymentExpiry />16  <InputPaymentCVC />17</InputPayment>

API Reference

Detailed documentation of properties and options.

InputPayment

alias: PaymentInput

Accepts every native attribute of the element it renders.

PropTypeDefaultDescription
autoFocusNext
boolean
true

Whether focus moves to the next field once a field is complete and valid, and back to the previous one on Backspace in an empty field.

cardCvc
string
Input OTPInput Phone
–

The security code. Use with onCardCvcChange to control it.

cardExpiry
string
–

The expiry date as MM/YY. Use with onCardExpiryChange to control it.

cardNumber
string
–

The card number, spaced in groups as it is shown. Use with onCardNumberChange to control it.

cardZip
string
–

The postal code. Use with onCardZipChange to control it.

children
ReactNode
–

The content of the component.

defaultCardCvc
string
–

The security code at first, when it isn't controlled.

defaultCardExpiry
string
–

The expiry date at first, when it isn't controlled.

defaultCardNumber
string
–

The card number at first, when it isn't controlled.

defaultCardZip
string
–

The postal code at first, when it isn't controlled.

defaultPaymentMethod
"card"|"upi"
card

The payment method selected at first, when it isn't controlled.

defaultUpiId
string
–

The UPI ID at first, when it isn't controlled.

disabled
boolean
false

Whether the component should ignore user interaction.

labels
Partial<InputPaymentLabels>
–

Replaces the built-in text — field names, placeholders and validation messages — for this instance. See LabelsProvider to change it everywhere.

onCardCvcChange
((val: string) => void)
–

Called with the security code as the user types, cut to the card brand's length.

onCardExpiryChange
((val: string) => void)
–

Called with the formatted expiry date as the user types.

onCardNumberChange
((val: string) => void)
–

Called with the formatted card number as the user types.

onCardZipChange
((val: string) => void)
–

Called with the postal code as the user types.

onPaymentMethodChange
((method: PaymentMethod) => void)
–

Called with the new method when the user switches between card and UPI.

onUpiIdChange
((val: string) => void)
–

Called with the UPI ID as the user types.

onValidationChange
((isValid: boolean, errors: PaymentInputErrors) => void)
–

Called whenever the details become valid or invalid, with a message for each field that has an error.

paymentMethod
"card"|"upi"
–

Whether the user is paying by card or upi. Use with onPaymentMethodChange to control it.

readOnly
boolean
false

Whether the value can be seen but not changed.

upiId
string
–

The UPI ID, such as name@bank. Use with onUpiIdChange to control it.

InputPaymentBrandIcon

alias: PaymentInputBrandIcon

Accepts render, plus every native <div> attribute.

PropTypeDefaultDescription
icon
ReactNode
–

Replaces this icon. Accepts any node; null renders no icon. Takes precedence over IconProvider.

InputPaymentCVC

alias: PaymentInputCVC

Accepts className, style and render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
defaultValue
string | number | readonly string[]
–

The default value of the input. Use when uncontrolled.

onChange
ChangeEventHandler<HTMLInputElement, Element>
–

Called with the input's change event, after the field has formatted and stored the new value.

onKeyDown
KeyboardEventHandler<HTMLInputElement>
–

Called with the input's keydown event. Call event.preventDefault() to stop the field's own handling, such as moving back to the previous field on Backspace.

onValueChange
((value: string, eventDetails: Input.ChangeEventDetails) => void)
–

Callback fired when the value changes. Use when controlled.

size
number|"lg"|"sm"|"default"
–

The size of the component.

InputPaymentCardNumber

alias: PaymentInputCardNumber

Accepts className, style and render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
defaultValue
string | number | readonly string[]
–

The default value of the input. Use when uncontrolled.

onChange
ChangeEventHandler<HTMLInputElement, Element>
–

Called with the input's change event, after the field has formatted and stored the new value.

onKeyDown
KeyboardEventHandler<HTMLInputElement>
–

Called with the input's keydown event. Call event.preventDefault() to stop the field's own handling, such as moving back to the previous field on Backspace.

onValueChange
((value: string, eventDetails: Input.ChangeEventDetails) => void)
–

Callback fired when the value changes. Use when controlled.

size
number|"lg"|"sm"|"default"
–

The size of the component.

InputPaymentExpiry

alias: PaymentInputExpiry

Accepts className, style and render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
defaultValue
string | number | readonly string[]
–

The default value of the input. Use when uncontrolled.

onChange
ChangeEventHandler<HTMLInputElement, Element>
–

Called with the input's change event, after the field has formatted and stored the new value.

onKeyDown
KeyboardEventHandler<HTMLInputElement>
–

Called with the input's keydown event. Call event.preventDefault() to stop the field's own handling, such as moving back to the previous field on Backspace.

onValueChange
((value: string, eventDetails: Input.ChangeEventDetails) => void)
–

Callback fired when the value changes. Use when controlled.

size
number|"lg"|"sm"|"default"
–

The size of the component.

InputPaymentGroup

alias: PaymentInputGroup

Accepts render, plus every native <div> attribute.

InputPaymentMethodSelector

alias: PaymentInputMethodSelector

Accepts className, style and render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
cardIcon
ReactNode
–

Replaces this icon. Accepts any node; null renders no icon. Takes precedence over IconProvider.

onValueChange
((value: any, eventDetails: TabsRootChangeEventDetails) => void)
–

Callback invoked when new value is being set.

The event reason is 'none' for user-initiated changes, such as a click or keyboard navigation; 'initial' for the first automatic selection or fallback in uncontrolled roots when defaultValue is omitted or undefined, including when the implicit initial value is disabled or missing; 'disabled' for automatic fallback when the selected tab becomes disabled in uncontrolled roots; or 'missing' for automatic fallback when the selected tab is removed, or when an explicit defaultValue never matches a mounted tab in uncontrolled roots.

For automatic changes, the selected value can be null when no enabled Tab is available as a fallback.

Automatic changes cannot be canceled; calling eventDetails.cancel() for 'initial', 'disabled', or 'missing' has no effect.

orientation
"horizontal"|"vertical"
'horizontal'

The component orientation (layout flow direction).

upiIcon
ReactNode
–

Replaces this icon. Accepts any node; null renders no icon. Takes precedence over IconProvider.

InputPaymentUpiGroup

alias: PaymentInputUpiGroup

Accepts render, plus every native <div> attribute.

InputPaymentUpiId

alias: PaymentInputUpiId

Accepts className, style and render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
defaultValue
string | number | readonly string[]
–

The default value of the input. Use when uncontrolled.

onChange
ChangeEventHandler<HTMLInputElement, Element>
–

Called with the input's change event, after the field has formatted and stored the new value.

onKeyDown
KeyboardEventHandler<HTMLInputElement>
–

Called with the input's keydown event. Call event.preventDefault() to stop the field's own handling, such as moving back to the previous field on Backspace.

onValueChange
((value: string, eventDetails: Input.ChangeEventDetails) => void)
–

Callback fired when the value changes. Use when controlled.

size
number|"lg"|"sm"|"default"
–

The size of the component.

InputPaymentUpiProviderIcon

alias: PaymentInputUpiProviderIcon

Accepts render, plus every native <div> attribute.

PropTypeDefaultDescription
icon
ReactNode
–

Replaces this icon. Accepts any node; null renders no icon. Takes precedence over IconProvider.

InputPaymentZip

alias: PaymentInputZip

Accepts className, style and render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
defaultValue
string | number | readonly string[]
–

The default value of the input. Use when uncontrolled.

onChange
ChangeEventHandler<HTMLInputElement, Element>
–

Called with the input's change event, after the field has formatted and stored the new value.

onKeyDown
KeyboardEventHandler<HTMLInputElement>
–

Called with the input's keydown event. Call event.preventDefault() to stop the field's own handling, such as moving back to the previous field on Backspace.

onValueChange
((value: string, eventDetails: Input.ChangeEventDetails) => void)
–

Callback fired when the value changes. Use when controlled.

size
number|"lg"|"sm"|"default"
–

The size of the component.