Skip to main content
A full-featured authentication component with email OTP, including error handling, loading states, and user experience improvements.

Implementation

Key features

  • Loading states - Shows spinner while MoonKey initializes
  • Error handling - Clear error messages for common issues
  • Email validation - Disables button when email is empty
  • Code formatting - Automatically strips non-numeric characters
  • Keyboard support - Press Enter to submit forms
  • State management - Tracks flow state (sending, logging-in)
  • User feedback - Shows appropriate messages at each step

Next steps

Styling Examples

Add CSS styles to this component

Protected Routes

Protect routes with authentication