Auth — Login
Anatomy
A composed application section with typed inputs and native HTML output.
maud_ui::blocks::auth::login
Props
Generated from public Rust fields. Defaults are evaluated from the implementation.
| Prop | Type | Default | Description |
|---|---|---|---|
action | String | "/login" | Form action URL — where the email + password form POSTs. The form sends email and password fields. |
logo | Option<Markup> | None | Optional logo shown above the heading. Typically an inline SVG or <img>. Use stroke="currentColor" on SVGs so they inherit --mui-text. |
heading | String | "Welcome back" | Primary heading (default: "Welcome back"). |
subheading | String | "Sign in to your account" | Secondary prompt below the heading (default: "Sign in to your account"). |
error | Option<String> | None | Optional error message to show above the form — rendered with the alert primitive in Danger variant. Typical use: render the login page with error: Some("Invalid email or password") after a failed POST. |
oauth_providers | Vec<OAuthProvider> | [] | OAuth providers to show above the email/password form. Empty vec = no OAuth row, no divider. |
forgot_password_url | Option<String> | None | URL for the "Forgot password?" link rendered next to the password label. None hides the link. |
signup_url | Option<String> | None | URL for the "Don't have an account? Sign up" prompt at the bottom of the card. None hides the prompt entirely — useful for invite-only products. |
email_value | String | "" | Email value to preserve across error re-renders (e.g., after a failed POST, the email stays filled in). |
submit_label | String | "Sign in" | Submit button label (default: "Sign in"). |
Examples
Welcome back
Sign in to continue to Acme
Usage
use maud_ui::blocks::auth::login;
login::render(login::Props {
action: "/auth/login".into(),
heading: "Welcome back".into(),
subheading: "Sign in to continue".into(),
oauth_providers: vec![
login::OAuthProvider {
id: "google".into(),
label: "Continue with Google".into(),
href: "/auth/oauth/google".into(),
icon: None,
},
],
forgot_password_url: Some("/auth/forgot".into()),
signup_url: Some("/auth/signup".into()),
// Re-render after failed POST to preserve the email + surface error:
// email_value: submitted_email,
// error: Some("Invalid credentials".into()),
..Default::default()
})Accessibility
Supply meaningful labels, choose heading levels for the surrounding page, and preserve native link and form behavior. Keyboard focus follows document order. Motion honors reduced-motion preferences.