Developer guide

React authentication components for account flows

Authentication components collect account identifiers, credentials, verification details, and recovery input while explaining validation and request state. This guide groups Spectrum UI login, input, password, multi-step, feedback, loading, and modal source for React and Next.js account flows.

These components do not authenticate users by themselves. Connect them to a reviewed identity provider or server-side authentication implementation, validate every request on the server, and avoid exposing account existence through inconsistent messages.

What Authentication Components means

Authentication UI is the visible boundary around a security-sensitive server workflow. The interface must preserve labels, autocomplete hints, password-manager behavior, error recovery, focus movement, and clear pending states while the server makes the actual decision.

Spectrum UI can supply the local presentation and interaction source. Your application still owns sessions, credentials, OAuth configuration, rate limits, verification, recovery tokens, authorization, and security logging.

When to use these patterns

01

You are implementing sign-in or registration

Combine labeled inputs, password feedback, and a pending action with server-side validation and identity-provider responses.

02

A flow spans several verification steps

Use multi-step structure when later input depends on an earlier verified state, while preserving recovery and back navigation.

03

Errors need safe, actionable feedback

Use alert and loading patterns that explain the next action without leaking whether a specific account exists.

Collect a new password with visible requirements

The component handles the input presentation and meter; the form action still validates the submitted password on the server.

pnpm dlx shadcn@latest add @spectrumui/password-strength
pnpm dlx shadcn@latest add button
CreatePasswordForm.tsx
'use client';

import { useState } from 'react';
import { PasswordStrengthInput } from '@/components/spectrumui/password-strength';
import { Button } from '@/components/ui/button';

export function CreatePasswordForm() {
  const [password, setPassword] = useState('');

  return (
    <form className="space-y-4">
      <PasswordStrengthInput
        id="new-password"
        name="password"
        value={password}
        onValueChange={setPassword}
      />
      <Button type="submit">Create account</Button>
    </form>
  );
}

Authentication Components questions

No. They provide interface source. Credentials, sessions, OAuth, verification, recovery, authorization, and rate limiting must be implemented and validated by your application.