The children of the pin input component
Pin Input
The PinInput component is similar to the Input component, but is optimized for entering sequences of digits quickly.
Props#
childrenrequired
childrenrequiredReactNodeautoFocus
autoFocusIf true, the pin input receives focus on mount
booleancolorScheme
colorSchemeColor Schemes for PinInput are not implemented in the default theme. You can extend the theme to implement them.
stringdefaultValue
defaultValueThe default value of the pin input
stringerrorBorderColor
errorBorderColorThe border color when the input is invalid. Use color keys in `theme.colors` @example errorBorderColor = "red.500"
stringfocusBorderColor
focusBorderColorThe border color when the input is focused. Use color keys in `theme.colors` @example focusBorderColor = "blue.500"
stringid
idThe 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. @example if id="foo", the first input will have `foo-0`
stringisDisabled
isDisabledIf true, the pin input component is put in the disabled state
booleanisInvalid
isInvalidIf true, the pin input component is put in the invalid state
booleanmanageFocus
manageFocusIf true, focus will move automatically to the next input once filled
booleantruemask
maskIf true, the input's value will be masked just like `type=password`
booleanonChange
onChangeFunction called on input change
((value: string) => void)onComplete
onCompleteFunction called when all inputs have valid values
((value: string) => void)otp
otpIf true, the pin input component signals to its fields that they should
use `autocomplete="one-time-code"`.
booleanplaceholder
placeholderThe placeholder for the pin input
stringsize
size"lg" | "md" | "sm" | "xs""md"type
typeThe type of values the pin-input should allow
"number" | "alphanumeric"value
valueThe value of the pin input. This is the value that will be returned when the pin input is filled
stringvariant
variant"outline" | "flushed" | "filled" | "unstyled""outline"PinInputField#
PinInputField composes Input so you can pass all Input props.
colorScheme
colorSchemeColor Schemes for Input are not implemented in the default theme. You can extend the theme to implement them.
stringerrorBorderColor
errorBorderColorThe border color when the input is invalid. Use color keys in `theme.colors` @example errorBorderColor = "red.500"
stringfocusBorderColor
focusBorderColorThe border color when the input is focused. Use color keys in `theme.colors` @example focusBorderColor = "blue.500"
stringhtmlSize
htmlSizeThe native HTML size attribute to be passed to the input
numberisDisabled
isDisabledIf 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
booleanisInvalid
isInvalidIf 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
booleanisReadOnly
isReadOnlyIf true, the form control will be readonly
booleanisRequired
isRequiredIf 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
booleansize
size"lg" | "md" | "sm" | "xs""md"variant
variant"outline" | "filled" | "flushed" | "unstyled""outline"