Authentication

Production-ready authentication page layouts built with Byteion components.

Overview

Authentication pages are the entry points to your application. They determine whether a user can access your product and how smoothly they can begin using it. Byteion provides production-ready layouts for sign-in, sign-up, password recovery, OTP verification, social authentication, and enterprise SSO — all built from core components (Card, Input, Button, Checkbox, Divider, Alert, Form Field). These patterns work across SaaS dashboards, admin panels, Laravel starter kits, React apps, Vue apps, ecommerce back offices, ERP and POS systems, and internal tools.

When to use

  • Sign-in pages for existing users
  • Sign-up or registration pages for new accounts
  • Password recovery flows — forgot password, reset password
  • OTP or multi-factor verification screens
  • Passwordless or magic-link authentication
  • Social OAuth provider selection
  • Enterprise SSO login with company domain

Authentication flows

The sign-in card layout is the base pattern from which all other auth flows are derived. Each flow uses the same centered card surface with flow-specific fields and actions.

Sign In

Email and password fields with "Remember me" checkbox, "Forgot password?" link, form-level credential error display, and optional social auth provider buttons below a divider. The most common auth entry point.

Sign Up

Registration form with name, email, password, and password confirmation fields. Includes terms agreement checkbox, autocomplete="new-password" on the password field, optional social sign-up, and a link back to sign-in.

Forgot Password

Single email field with a "Send reset link" button. On submission, show a neutral confirmation message — do not reveal whether the email exists in your system. Limits account enumeration.

Reset Password

New password and confirm password fields with clear requirements listed in helper text. Handles token-expired state with a "Request new link" action. Uses autocomplete="new-password" on both fields.

OTP Verification

One-time code input with individual digit slots or a single masked input. Supports autocomplete="one-time-code", inputmode="numeric", paste support, resend timer, and error state for expired or invalid codes.

Passwordless / Magic Link

Single email field with a "Send magic link" button. After submission, show a neutral confirmation with instructions to check the inbox. No password field needed.

Social OAuth

Provider buttons (Google, GitHub, Microsoft, etc.) with accessible labels. Separated from email/password fields by a divider. Buttons show provider name and icon. Each button triggers a provider redirect with loading state.

Enterprise SSO

Company domain or email input field, optional SSO provider selector, and a "Contact your admin" help link for users who cannot sign in. Used for SAML or OpenID Connect enterprise integrations.

Full UI example

Complete sign-in page implementation with validation-ready structure:

Sign in to Byteion

Enter your credentials to access your account.

Forgot password?
Or continue with

Don't have an account? Sign up

Component breakdown

This layout combines these Byteion components:

Card

The outer container provides surface, border, shadow, and padding for the auth form.

Form Field

Wraps each label, control, helper text, and validation message into a consistent, accessible group.

Input

Email and password fields with focus states, validation-ready classes, and autocomplete support.

Button

Primary action button with hover, focus, and disabled states for loading protection.

Checkbox

"Remember me" toggle with proper label association and focus ring.

Divider

Visual separation between the email/password form and social auth options.

Alert

Form-level error summary shown above the card or between the title and form fields for credential errors.

Spinner

Loading indicator inside the submit button while the authentication request is in progress.

Validation and error states

Authentication forms should handle validation at two levels: field-level and form-level. Field-level errors appear below the specific control. Form-level errors appear as an Alert above the form.

Field-level validation

  • Invalid email format — "Please enter a valid email address."
  • Missing required field — "Password is required."
  • Weak password — "Must be at least 8 characters with a number and a letter."
  • Invalid OTP — "The code you entered is incorrect or expired."
  • Password mismatch — "Passwords do not match."

Form-level validation

  • Invalid credentials — "Invalid email or password. Please try again." Use a generic message; do not reveal whether the email exists.
  • Account locked or disabled — "Your account has been temporarily locked. Please try again later or contact support."
  • Rate-limited — "Too many attempts. Please try again in a few minutes."
  • Session expired — "Your session has expired. Please sign in again."

Validation behavior

  • Validate on blur for field-level format and requirement checks.
  • Show credential errors only after form submission — never before.
  • Do not reveal whether an email exists during password recovery. Show a neutral message: "If an account with this email exists, you will receive a reset link shortly."
  • Show password reset and magic-link confirmation messages neutrally.
  • Preserve user input after validation failure except for sensitive fields (password, OTP) when security policy requires it.
  • Prevent duplicate submissions by disabling the submit button while loading.

Accessibility

  • Every field must have a visible label. Placeholder text is not a label — it disappears on input and fails WCAG 3.3.2.
  • Use aria-describedby to connect helper text and error messages to their form control. Screen readers announce the description when the field receives focus.
  • Use aria-invalid="true" on fields with validation errors. This tells assistive technology the value is not valid.
  • Use an error summary for form-level failures. After a failed submission, render an Alert with role="alert" at the top of the form and move focus to it using tabindex="-1".
  • Move focus to the first invalid field after a failed submission so keyboard and screen-reader users can immediately correct the issue.
  • OAuth buttons must include the provider name in accessible text. An icon-only button with aria-label="Sign in with Google" meets this requirement. A bare icon does not.
  • OTP inputs must remain keyboard-friendly. Each digit slot should be reachable, and the group should support paste from SMS or authenticator apps.
  • Do not rely on color alone for error or success states. Use text labels, icons, and aria-invalid in addition to text-danger.

Mobile and password-manager support

Authentication pages must work reliably with browser password managers and mobile keyboards. Use the correct input types and autocomplete attributes for every field:

Field Type Autocomplete Input mode
Email email email email
Password (sign-in) password current-password text
Password (sign-up/reset) password new-password text
OTP code text one-time-code numeric

Additional guidance

  • Mask passwords by default. Add a show/hide password toggle (eye icon) when users need to verify what they typed — especially on sign-up and reset-password screens.
  • Do not remove password manager support. Always set autocomplete correctly. Never use autocomplete="off" on password fields.
  • Do not block paste in password or OTP fields. Users rely on paste from password managers and SMS apps.
  • Keep name attributes predictable — password managers use name to identify fields across sessions.
  • Use type="email" on email fields to trigger the email keyboard on mobile (with @ and . shortcuts).

Loading and disabled states

  • Disable the submit button while submitting — use the disabled prop or attribute to prevent double submissions.
  • Show Button loading state — when the Button component supports loading, show a Spinner inside the button while the request is in flight.
  • Prevent duplicate requests — disable all form controls during submission, not just the submit button.
  • Keep OAuth buttons disabled while a provider redirect is starting to prevent multiple redirect attempts.
  • Show neutral success states after password recovery or magic-link requests — confirm the action without revealing user status.

Security and privacy notes

  • Do not expose account existence in recovery flows. Use a generic message: "If an account with this email exists, you will receive instructions shortly."
  • Do not log passwords or OTP values on the client side. Never send sensitive values to analytics or error-tracking services.
  • Avoid putting tokens in visible examples. Use placeholder values like <token> or YOUR_API_KEY in documentation.
  • Use HTTPS in production. Authentication pages must always be served over a secure connection.
  • Backend must handle rate limiting, account lockout, email verification, session security, CSRF tokens, and MFA where required. The UI should not claim security guarantees that the backend does not enforce.
  • Do not disable password managers — they improve security by generating and storing strong, unique passwords.
  • Keep OTP codes transient. OTP inputs should clear after a failed attempt and never cache the value.

Auth layout patterns

Authentication screens follow a few common layout patterns. Choose the one that matches your brand and use case.

Centered card

The default pattern. A single card centered on the page with the logo, form, and links. Best for most SaaS apps.

Split-screen brand

Form on the left, brand imagery or testimonial on the right. Used for marketing-heavy landing pages and enterprise products.

Minimal mobile-first

Full-screen form with no card boundary on small viewports. Logo and form fill the screen. Common in mobile apps.

Enterprise SSO

Company domain or email field shown first, then redirects to the SSO provider. Minimal visual clutter.

Passwordless / OTP

Single input focused on email (magic link) or code (OTP). The card is smaller and more focused. No password field visible.

Best practices

Do

  • Use visible labels for every form field
  • Use Form Field for consistent label, helper, and error composition
  • Set autocomplete attributes on every field
  • Provide clear forgot-password and sign-up paths from the sign-in page
  • Keep auth cards focused and mobile-friendly — one primary action per screen
  • Use neutral, generic security messaging in recovery flows
  • Test with keyboard-only navigation before every release

Don't

  • Use placeholder-only labels — they disappear on input
  • Reveal whether an email exists during password recovery
  • Block paste in password or OTP fields
  • Show credential errors before the form is submitted
  • Disable password managers with autocomplete="off"
  • Make social auth look like the same action as email/password submit
  • Hide sign-up or reset links — new users and forgetful users need clear paths

Variations

Social-only

For apps that only support OAuth. Skip email/password fields entirely and show provider buttons with a brief explanation.

Passwordless

Magic link sent to email. Single field for email with "Send magic link" button. No password field needed.

OTP-first

Email or phone field followed by an OTP input in a two-step flow. Used for passwordless verification and MFA.

Enterprise SSO

Includes company domain/email input, SSO provider option, and a "Contact your admin" help link for enterprise users.

Developer tips

• Use type="email" and type="password" — this triggers the correct keyboard on mobile devices.\n• Set autocomplete attributes — email for email, current-password for sign-in, new-password for sign-up and reset, one-time-code for OTP.\n• Show errors after submit, not on every keystroke. Validate on blur for field-level requirements, but only show credential errors after the form is submitted.\n• Use the same Card + Form Field + Input + Button composition. Auth pages demonstrate Byteion's compositional approach at its simplest.\n• Mask passwords by default. Add a show/hide toggle for sign-up and reset flows where users need to verify what they typed.\n• For OAuth buttons, include the provider name in visible text or aria-label. A Google logo alone is not accessible.\n• Always test with keyboard navigation — Tab through fields, verify focus order, test the show/hide password toggle, and confirm error announcements.

Common mistakes

  • Placeholder-only labels — placeholder disappears on input and fails WCAG. Always use visible labels.
  • Revealing account existence during recovery — "No account found" or "Reset link sent" differently enables email enumeration.
  • Blocking paste on password or OTP fields — users rely on paste from password managers and SMS apps.
  • Showing errors before submission — credential errors should only appear after the form is submitted.
  • Missing autocomplete attributes — without these, password managers cannot fill fields and mobile keyboards use incorrect layouts.
  • Using autocomplete="off" on password fields — this disables password managers and harms security.
  • Not disabling the submit button while loading — double submissions cause duplicate requests and confusing error states.
  • Hiding sign-up or reset links — new users need clear paths to create accounts and recover access.

Production checklist

  • Test form validation with keyboard only — Tab through all fields, verify error announcements, confirm focus moves to the first invalid field.
  • Test screen reader announcements — labels, helper text, and error messages must all be announced when the field receives focus.
  • Test dark mode and branded themes — all tokens (bg-card, text-foreground, text-muted-foreground, text-danger) must remain distinguishable.
  • Test mobile viewports — ensure the card does not overflow and all fields are reachable.
  • Test password-manager autofill on multiple browsers — Chrome, Safari, Firefox, Edge, and 1Password/Bitwarden.
  • Test OTP paste from SMS and authenticator apps on iOS and Android.
  • Test server-side validation errors mapped to the correct field.
  • Verify all autocomplete attributes are correct per form context.
  • Confirm no tokens, secrets, or API keys appear in any visible examples.
  • Test loading and disabled states — submit button must be disabled while the request is in flight.

Premium examples

Advanced patterns available in Pro extend authentication into richer product contexts and multi-step flows.

  • Multi-step onboarding auth flow — sign-up followed by workspace creation, team invitation, and preference setup, each in a separate Card step coordinated with Stepper.
  • Enterprise SSO screen — company email input that detects the SSO provider and redirects to the identity provider. Includes a "Contact your IT admin" help link.
  • OTP verification flow — email or phone input followed by a 6-digit OTP input with auto-submit, resend timer, and error handling for expired codes.
  • Passwordless magic-link flow — single email field with "Send magic link" button and a confirmation screen with instructions to check the inbox.
  • Branded split-screen auth template — full-page layout with brand illustration, testimonial quote, or product screenshot on one side and the auth form on the other.
  • Auth form with validation summary — Alert at the top of the form listing all field errors after a failed submission, with links that move focus to each invalid field.
  • Social auth provider grid — a 3x2 or 2x2 grid of provider buttons (Google, GitHub, Microsoft, Apple, GitLab, Bitbucket) with icons and accessible labels, separated from the email form by a divider.

Unlock Premium Patterns

Get access to copy-paste ready Pro blocks, SaaS templates, and advanced component patterns.

Explore Pro Components