If true
, the pin input receives focus on mount
Pin Input
The PinInput component is similar to the Input component, but is optimized for entering sequences of digits quickly.
Props#
autoFocus
autoFocus
boolean
colorScheme
colorScheme
The visual color appearance of the component
"whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink"
defaultValue
defaultValue
The default value of the pin input
string
errorBorderColor
errorBorderColor
The border color when the input is invalid. Use color keys in `theme.colors`
string
focusBorderColor
focusBorderColor
The border color when the input is focused. Use color keys in `theme.colors`
string
id
id
The top-level id string that will be applied to the input fields. The index of the input will be appended to this top-level id.
string
isDisabled
isDisabled
If true
, the pin input component is put in the disabled state
boolean
isInvalid
isInvalid
If true
, the pin input component is put in the invalid state
boolean
manageFocus
manageFocus
If true
, focus will move automatically to the next input once filled
boolean
true
mask
mask
If true
, the input's value will be masked just like `type=password`
boolean
onChange
onChange
Function called on input change
(value: string) => void
onComplete
onComplete
Function called when all inputs have valid values
(value: string) => void
otp
otp
If true
, the pin input component signals to its fields that they should
use `autocomplete="one-time-code"`.
boolean
placeholder
placeholder
The placeholder for the pin input
string
size
size
The size of the PinInput
"lg" | "md" | "sm" | "xs"
md
type
type
The type of values the pin-input should allow
"number" | "alphanumeric"
value
value
The value of the pin input. This is the value that will be returned when the pin input is filled
string
variant
variant
The variant of the PinInput
"outline" | "flushed" | "filled" | "unstyled"
outline
PinInputField#
PinInputField composes Input
so you can pass all Input
props.
colorScheme
colorScheme
The visual color appearance of the component
"whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink"
isDisabled
isDisabled
If true
, the form control will be disabled. This has 2 side effects:
- The FormLabel
will have `data-disabled` attribute
- The form element (e.g, Input) will be disabled
boolean
false
isInvalid
isInvalid
If true
, the form control will be invalid. This has 2 side effects:
- The FormLabel
and FormErrorIcon
will have `data-invalid` set to true
- The form element (e.g, Input) will have `aria-invalid` set to true
boolean
false
isReadOnly
isReadOnly
If true
, the form control will be readonly
boolean
false
isRequired
isRequired
If true
, the form control will be required. This has 2 side effects:
- The FormLabel
will show a required indicator
- The form element (e.g, Input) will have `aria-required` set to true
boolean
false
size
size
The size of the Input
"lg" | "md" | "sm" | "xs"
md
variant
variant
The variant of the Input
"outline" | "filled" | "flushed" | "unstyled"
outline
Props#
autoFocus
autoFocus
If true
, the pin input receives focus on mount
boolean
colorScheme
colorScheme
The visual color appearance of the component
"whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink"
defaultValue
defaultValue
The default value of the pin input
string
errorBorderColor
errorBorderColor
The border color when the input is invalid. Use color keys in `theme.colors`
string
focusBorderColor
focusBorderColor
The border color when the input is focused. Use color keys in `theme.colors`
string
id
id
The top-level id string that will be applied to the input fields. The index of the input will be appended to this top-level id.
string
isDisabled
isDisabled
If true
, the pin input component is put in the disabled state
boolean
isInvalid
isInvalid
If true
, the pin input component is put in the invalid state
boolean
manageFocus
manageFocus
If true
, focus will move automatically to the next input once filled
boolean
true
mask
mask
If true
, the input's value will be masked just like `type=password`
boolean
onChange
onChange
Function called on input change
(value: string) => void
onComplete
onComplete
Function called when all inputs have valid values
(value: string) => void
otp
otp
If true
, the pin input component signals to its fields that they should
use `autocomplete="one-time-code"`.
boolean
placeholder
placeholder
The placeholder for the pin input
string
size
size
The size of the PinInput
"lg" | "md" | "sm" | "xs"
md
type
type
The type of values the pin-input should allow
"number" | "alphanumeric"
value
value
The value of the pin input. This is the value that will be returned when the pin input is filled
string
variant
variant
The variant of the PinInput
"outline" | "flushed" | "filled" | "unstyled"
outline
PinInputField#
PinInputField composes Input
so you can pass all Input
props.
colorScheme
colorScheme
The visual color appearance of the component
"whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink"
isDisabled
isDisabled
If true
, the form control will be disabled. This has 2 side effects:
- The FormLabel
will have `data-disabled` attribute
- The form element (e.g, Input) will be disabled
boolean
false
isInvalid
isInvalid
If true
, the form control will be invalid. This has 2 side effects:
- The FormLabel
and FormErrorIcon
will have `data-invalid` set to true
- The form element (e.g, Input) will have `aria-invalid` set to true
boolean
false
isReadOnly
isReadOnly
If true
, the form control will be readonly
boolean
false
isRequired
isRequired
If true
, the form control will be required. This has 2 side effects:
- The FormLabel
will show a required indicator
- The form element (e.g, Input) will have `aria-required` set to true
boolean
false
size
size
The size of the Input
"lg" | "md" | "sm" | "xs"
md
variant
variant
The variant of the Input
"outline" | "filled" | "flushed" | "unstyled"
outline