FrontendArk

Master Frontend Interviews

  • Practice
  • Playground
  • Resource
Hard

Auth Code Input

60 mins

Build an Auth Code Input component in React.

Requirements:

  1. Display six individual input boxes for a 6-digit code.
  2. Automatically move focus to the next input when a digit is entered.
  3. Support backspace to move focus back to the previous input.
  4. Allow pasting the full code into the first input and populate all fields.
  5. Collect the digits into a single value and call a callback on completion.
  6. Focus on functionality over styling.

Code Editor

React Component

00:00
Loading...

Live Preview

See your React component