Keyframery

Combination OTP

New

Type or paste 482019. Anything else jams the drums.

Installation

npx shadcn add @keyframery/combination-otp

Props

PropTypeDefaultWhat it does
verify(code: string) => boolean | Promise<boolean>—Runs once every digit is in. Return true when the code is right.
onVerified(code: string) => void—Runs once the Verified chip is showing.
lengthnumber6How many digits the code has.
size"sm" | "md" | "lg""md"How big the slots are.
messages{ checking?, verified?, rejected? }—Your own wording. Verified sits inside a small chip, so keep that one short.
autoFocusbooleanfalseFocus the field when it mounts.
disabledbooleanfalseStops input.
aria-labelstring"One-time code"What screen readers call the field.

Accessibility and motion

  • Paste works, and so does autofill from a text message. Underneath sits input-otp, the same library shadcn's own OTP field uses.
  • Screen readers get an ordinary code field and hear the result when it comes back.
  • With reduced motion turned on, digits simply appear. Nothing spins, and the light jumps instead of sliding.
  • The light takes its colour from --kf-accent and the check from --kf-success. Leave them unset and you get blue and green.

On this page