0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…
Login form patterns with social authentication, two-factor input, and responsive layouts. Accessible and progressively enhanced.
Overview
Sign-in forms are critical user touchpoints that require careful attention to usability, accessibility, and security. These patterns demonstrate best practices using Vanilla Breeze's data-layout attributes and custom elements.
Key features:
data-layout attributes for layout without wrapper elements
<form-field> with validation messages using <output>
<text-divider> for separating authentication methods
<brand-mark> for consistent logo display
Progressive OTP enhancement with data-type="otp"
Proper autocomplete attributes for password managers
Password toggle (auto-enhanced by JS)
Simple Card Form
A centered login form using data-layout="cover" on the body for vertical centering, with <layout-card> constraining the width. The form itself uses data-layout="stack" for vertical spacing.
<bodydata-layout="cover"data-layout-min="xl"data-layout-padding="l"><layout-carddata-max="narrow"data-padding="l"data-layout-principal><formaction="/auth/login"method="POST"data-layout="stack"data-layout-gap="l"><headerdata-layout="stack"data-layout-gap="s"><h1>Sign in</h1><p>Welcome back! Please enter your details.</p></header><form-field><labelfor="email">Email</label><inputtype="email"id="email"name="email"requiredautocomplete="email"placeholder="[email protected]"aria-describedby="email-error"/><outputid="email-error"class="error"for="email"aria-live="polite"> Please enter a valid email address.</output></form-field><form-field><labelfor="password">Password</label><inputtype="password"id="password"name="password"requiredautocomplete="current-password"placeholder="Enter your password"aria-describedby="password-error"/><outputid="password-error"class="error"for="password"aria-live="polite"> Password is required.</output></form-field><fieldsetdata-variant="minimal"data-layout="cluster"data-layout-justify="between"data-layout-align="center"><legendclass="visually-hidden">Sign-in options</legend><label><inputtype="checkbox"name="remember"/> Remember me</label><ahref="/auth/forgot-password">Forgot password?</a></fieldset><buttontype="submit">Sign in</button><footer><p>Don't have an account? <ahref="/auth/register">Sign up</a></p></footer></form></layout-card></body>
Split Screen Layout
A two-column layout using data-layout="split" with a branded panel alongside the form. The <brand-mark> element provides consistent logo display. Collapses to single column on mobile.
<body><sectiondata-layout="split"data-layout-filldata-layout-gap="none"data-layout-align="stretch"data-layout-nowrap><!-- Brand Panel --><asideclass="brand-panel"data-layout="cover"data-layout-min="auto"data-layout-padding="xl"><headerdata-layout="stack"data-layout-gap="l"data-layout-principal><brand-markdata-size="xl">Acme Inc</brand-mark><h2>Welcome back</h2><p>Sign in to access your dashboard and continue where you left off.</p></header></aside><!-- Form Panel --><maindata-layout="cover"data-layout-min="auto"data-layout-padding="xl"><layout-centerdata-layout-max="narrow"data-layout-principal><formaction="/auth/login"method="POST"data-layout="stack"data-layout-gap="l"><h1>Sign in to your account</h1><form-field><labelfor="email">Email address</label><inputtype="email"id="email"name="email"requiredautocomplete="email"placeholder="[email protected]"aria-describedby="email-error"/><outputid="email-error"class="error"for="email"aria-live="polite"> Please enter a valid email address.</output></form-field><form-field><labelfor="password">Password</label><inputtype="password"id="password"name="password"requiredautocomplete="current-password"placeholder="Enter your password"aria-describedby="password-error"/><outputid="password-error"class="error"for="password"aria-live="polite"> Password is required.</output></form-field><fieldsetdata-variant="minimal"data-layout="cluster"data-layout-justify="between"data-layout-align="center"><legendclass="visually-hidden">Sign-in options</legend><label><inputtype="checkbox"name="remember"/> Remember me</label><ahref="/auth/forgot-password">Forgot password?</a></fieldset><buttontype="submit">Sign in</button><footer><p>Don't have an account? <ahref="/auth/register">Create one</a></p></footer></form></layout-center></main></section></body>
Sign-in form with social authentication buttons above traditional email/password fields. Uses the <text-divider> element to visually separate authentication methods.
<bodydata-layout="cover"data-layout-min="xl"data-layout-padding="l"><layout-carddata-max="narrow"data-padding="l"data-layout-principal><layout-stackdata-layout-gap="l"><headerdata-layout="stack"data-layout-gap="s"><h1>Sign in</h1><p>Choose your preferred sign-in method.</p></header><!-- Social Login Buttons --><layout-stackdata-layout-gap="s"><buttontype="button"class="secondary"><icon-wcname="brand-google"></icon-wc> Continue with Google</button><buttontype="button"class="secondary"><icon-wcname="brand-github"></icon-wc> Continue with GitHub</button></layout-stack><!-- Divider using text-divider element --><text-divider>or continue with email</text-divider><!-- Email/Password Form --><formaction="/auth/login"method="POST"data-layout="stack"data-layout-gap="l"><form-field><labelfor="email">Email</label><inputtype="email"id="email"name="email"requiredautocomplete="email"placeholder="[email protected]"aria-describedby="email-error"/><outputid="email-error"class="error"for="email"aria-live="polite"> Please enter a valid email address.</output></form-field><form-field><labelfor="password">Password</label><inputtype="password"id="password"name="password"requiredautocomplete="current-password"placeholder="Enter your password"aria-describedby="password-error"/><outputid="password-error"class="error"for="password"aria-live="polite"> Password is required.</output></form-field><fieldsetdata-variant="minimal"data-layout="cluster"data-layout-justify="between"data-layout-align="center"><legendclass="visually-hidden">Sign-in options</legend><label><inputtype="checkbox"name="remember"/> Remember me</label><ahref="/auth/forgot-password">Forgot password?</a></fieldset><buttontype="submit">Sign in</button></form><footer><p>Don't have an account? <ahref="/auth/register">Sign up</a></p></footer></layout-stack></layout-card></body>
Two-Factor Authentication
A verification code input using the progressive OTP enhancement. The input uses data-type="otp" and data-length="6" to enable multi-box display with JavaScript, while working as a standard text input without it.
<bodydata-layout="cover"data-layout-min="xl"data-layout-padding="l"><layout-carddata-max="narrow"data-padding="l"data-layout-principal><formaction="/auth/verify"method="POST"data-layout="stack"data-layout-gap="l"><headerdata-layout="stack"data-layout-gap="s"><h1>Two-factor authentication</h1><p>Enter the 6-digit code from your authenticator app.</p></header><!-- OTP Input - Progressive Enhancement Pattern --><form-fielddata-no-icon><labelfor="code">Verification code</label><inputtype="text"id="code"name="code"data-type="otp"data-length="6"inputmode="numeric"pattern="[0-9]{6}"autocomplete="one-time-code"requiredaria-describedby="code-msg"/><outputid="code-msg"for="code"aria-live="polite"> Enter the 6-digit code from your authenticator app</output></form-field><buttontype="submit">Verify</button><footerdata-layout="stack"data-layout-gap="s"><p>Didn't receive a code? <ahref="#resend">Resend</a></p><ahref="/auth/login">← Back to sign in</a></footer></form></layout-card></body>
Progressive Enhancement
The OTP input pattern provides graceful degradation:
Without JS: Standard text input accepting 6 digits
With JS: Multi-box UI with automatic focus advance, backspace navigation, and paste support
No custom JavaScript required - the <form-field> enhancement handles everything automatically when it detects data-type="otp".
Form Field Features
All these patterns use <form-field> which provides:
Validation icons: Checkmark/X appear after user interaction (disable with data-no-icon)
Password toggle: Show/hide button added automatically to password fields
Error messages: Use <output class="error"> with aria-live="polite"
Required indicator: Asterisk added automatically to required field labels
Usage Notes
Autocomplete: Use autocomplete="email" and autocomplete="current-password" for password manager support
OTP autocomplete: Use autocomplete="one-time-code" for SMS/app code autofill
Remember me: Include a checkbox for persistent sessions
Password recovery: Always provide a visible "Forgot password?" link
Social login: Use <icon-wc> with brand icons for recognizable buttons
Accessibility: All inputs have labels, validation messages use aria-live, and focus states are visible