Login Page
Sourcecomponents/sections/LoginSection.astro
The page
A full-bleed login page on a washed background image — magic-link first, with a password fallback. Composed from Input, Password, Button and Inline Link. Nothing here is bespoke.
Switch viewport — the page renders at each breakpoint's true size, scaled to fit. Live size shown top-right.
States
The state prop switches screens: request a magic link, sign in with a password, the "check your email" confirmation, forgot-password, and the error state.
state="magic"
Welcome to the Alchemy Labs
Sign in with a magic link
No account yet? Learn more
state="error"
Welcome to the Alchemy Labs
Sign in with a magic link
No account yet? Learn more
state="password"
Welcome to the Alchemy Labs
Sign in with your password
No account yet? Learn more
state="password-error"
Welcome to the Alchemy Labs
Sign in with your password
No account yet? Learn more
state="sent"
Built from
- Input — the email field
- Password — the password field (on the password state)
- Button — the full-width primary CTA
- Inline Link — the "password", "forgot" and sign-up links
Props
| Prop | Type | Default | Notes |
|---|---|---|---|
state | 'magic' | 'sent' | 'password' | 'forgot' | 'error' | 'password-error' | 'magic' | Which screen to show. |
image | string | '/img/hero.jpg' | Full-bleed background image (always present). |
action | string | '#' | Form action / endpoint. |
error | string | — | Email error shown on state="error". |
passwordError | string | — | Password error shown on state="password-error". |
sentTo | string | — | Email echoed on state="sent". |
passwordHref | string | '#' | "Sign in with password" destination. |
magicHref | string | '#' | Magic-link / resend destination. |
forgotHref | string | '#' | "Forgot password?" destination. |
signupHref | string | '#' | Sign-up destination. |
Usage
Drop it on a route and point the form and links at your endpoints.
---
import LoginSection from '../components/sections/LoginSection.astro';
---
<LoginSection
state="magic"
action="/api/magic-link"
passwordHref="/login/password"
signupHref="/signup"
/> Rules
Reuse the DS components as-is — never restyle fields or buttons here.
Keep it to the essentials: email, password, remember, submit.
Add fields that belong on sign-up (name, company) — link out to it instead.
Hard-code copy — pass it via props.