On this page

Input OTP

When to use Input OTP, when to use something else, and tokens.

Draft. Ported from the shadcn-vue Input OTP and restyled with Beehexa tokens. Not yet approved; the API may still change.

A field for a one-time code, with one box per character.

When to use

  • A code sent by email or SMS, for sign-in or confirming an action.

When not to use

  • A code whose length varies, such as 6 digits from an authenticator app or 8 characters by email. Use one Input in the large size.
  • A PIN people choose themselves. Use Pin input.
  • A password. Use an Input of type password.

Tokens

Part Tokens
Box 32 px square (size.control.default); size="lg" 40 px (size.control.large), 1 px color.border.bold on color.surface
Text font.code.default
Active box the text-field focus: the edge turns color.border.focus with a 2 px inset ring of the same colour
Invalid color.border.danger