Overview
The PinInput component provides a multi-input field for entering verification codes, PINs, or OTP codes with automatic focus management.Basic Usage
- Code
- Preview
With Label
- Code
- Preview
With Error State
- Code
- Preview
Disabled
- Code
- Preview
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
PIN input component for verification codes
import { PinInput } from '@peppermint-design/devreadykit-custom';
import { useState } from 'react';
export default function VerificationBasic() {
const [value, setValue] = useState('');
return (
<PinInput
length={6}
value={value}
onChange={setValue}
/>
);
}
import { PinInput } from '@peppermint-design/devreadykit-custom';
import { useState } from 'react';
export default function VerificationWithLabel() {
const [value, setValue] = useState('');
return (
<PinInput
length={4}
label="Enter verification code"
value={value}
onChange={setValue}
/>
);
}
import { PinInput } from '@peppermint-design/devreadykit-custom';
import { useState } from 'react';
export default function VerificationWithError() {
const [value, setValue] = useState('');
return (
<PinInput
length={6}
value={value}
onChange={setValue}
error={true}
errorMessage="Invalid code"
/>
);
}
import { PinInput } from '@peppermint-design/devreadykit-custom';
import { useState } from 'react';
export default function VerificationDisabled() {
const [value, setValue] = useState('123456');
return (
<PinInput
length={6}
value={value}
onChange={() => {}}
disabled
/>
);
}