Skip to content
PixiKit

Code Entry

A verification card with one box per character: typing, deleting, arrows and paste move between boxes, a blinking caret marks the active one, and busy, error and success states play on the row.

pixikit.com/docs/blocks/auth/code-entry

Customize

Length6
Group3
Kind
Resend wait30s
Auto submit

Props

17
NameTypeDefaultDescription
headingstring"Check your inbox"The heading of the card.
textstring"Enter the 6 digit code we sent you."The line under the heading.
lengthnumber6How many characters the code has.
groupnumber3Boxes per visual group, with a small dash between groups; 0 for no grouping.
kind"digits" | "letters""digits"Whether the code is made of digits or letters.
submitLabelstring"Verify"The label of the submit button.
resendLabelstring"Send a new code"The label of the resend button.
resendWaitnumber30Seconds before a new code can be asked for.
waitLabelstring"New code in {s}s"The resend label while counting; `{s}` is the seconds left.
errorTextstring"That code did not match"The text shown when the code did not match.
successTextstring"Verified"The text shown when the code matched.
backLink{ label: string; href: string } | null{ label: "Use another way", href: "#" }A link under the card; null hides it.
autoSubmitbooleantrueSubmit as soon as the last box is filled.
labelsPartial<CodeEntryLabels>NoneEvery other announced string.
onComplete(code: string) => boolean | void | Promise<boolean | void>NoneCalled with the code; false or a rejection shows the error, anything else shows success.
onResend() => voidNoneCalled when the resend button is pressed.
classNamestringNone

Related