2.0 alpha
These docs describe 2.0. Install it with @once-ui-system/core@alpha.
On 1.8.x? Read the 1.x docs
TrademarkTrademarkDocs
Ctrl k
Search docs...
Form Controls

OTPInput

Updated: September 14, 2026
View on GitHub
OTPInput collects a one-time code as separate boxes rather than one field. It moves focus as digits are typed, accepts a pasted code into all boxes at once, and calls onComplete the moment the last one is filled. Unlike the other inputs here it does not extend Input — it is a group of fields, not one, so it has its own small surface.
Prop
Type
Default
length
How many digits, and so how many boxes.
number4
onComplete
Called with the full code once the last box is filled.
(code: string) => void
error
Put the group in its error state.
booleanfalse
errorMessage
Message shown under the boxes when error is set.
React.ReactNode
disabled
Block input across every box.
booleanfalse
autoFocus
Focus the first box on mount. Leave it off if the code is not the first thing on the page.
booleanfalse
Edit this page on GitHub
TrademarkTrademark
Built with curiosity by Lorant One and the Design Engineers Club