OTP Input
Design System - OTP input component

// Sample code
const Component = () => {
const [otp, setOtp] = useState("");
//Example onChange logic
const handleOtpChange = (value) => {
setOtp(value);
if (value.length === args.length) {
const isValid = value.includes(1);
if (isValid) {
console.log("OTP is correct");
return null;
} else {
console.log("Invalid OTP");
return "Invalid OTP";
}
}
return null;
};
return <OTPInput length={6} type="numeric" onChange={handleOtpChange} placeholder={"123456"} label="Enter OTP" inline={false} className="" style={{ }} />;
};Anatomy

Variants
Properties
Property Configuration Table
Property
Value
Default
Property
Value
Default
Interaction State
Behaviours
Usage Guide
Changelog
Date
Number
Notes
Design Checklist
Last updated
Was this helpful?










