GitHub

MagicLinkForm

A passwordless sign-in form that sends a magic link to the user's email address.

Loading...

Installation

pnpm add @corew500/ui

Usage

import { MagicLinkForm } from '@corew500/ui/blocks/magic-link-form'

<MagicLinkForm
  onFormSubmit={(data) => handleMagicLink(data)}
  title="Sign in with a Magic Link"
  description="Enter your email and we'll send you a secure link to sign in without a password."
/>

API Reference

Props

PropTypeDefaultDescription
onFormSubmit(data: MagicLinkFormData) => voidCalled when the form is submitted
onResend() => voidCalled when resend is clicked
loadingenumfalseWhether the form is in a loading state
successenumfalseWhen true, shows success state instead of form
glowenumfalseEnable glow effects
titlestringSign in with magic link
descriptionstringEnter your email and we'll send you a magic link to sign in instantly.
successTitlestringCheck your email
successDescriptionstringWe've sent you a magic link to sign in.
successSubDescriptionstringClick the link in your email to continue. If you don't see it, check your spam folder.
successActionenum
labels{ email?: string; }{}
placeholders{ email?: string; }{}
buttonLabels{ submit?: string; loading?: string; resend?: string; resendCooldown?: string; backToLogin?: string; }{}
errors{ email?: string; general?: string; }{}
backToLoginHrefstring#
resendCooldownnumber60Resend cooldown in seconds