Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Evaluation guide · 20 minutes

Ship an accessible settings screen.

Test Lumen on a compact but production-shaped surface: labeled inputs, preference state, validation, save feedback, responsive layout, and keyboard behavior.

Step 1

Install the package for the application you already have.

Keep the current framework and architecture. Lumen provides a native adapter for each web target; it does not require a migration to Astro.

bash
pnpm add @santi020k/lumen-astro
Step 2

Compose the smallest useful settings surface.

Start from structure and behavior. The product owns persistence and request state; Lumen owns the accessible presentation contract.

astro
---
import '@santi020k/lumen-astro/styles.css'
import { Alert, Button, Card, Field, Input, Label, Switch } from '@santi020k/lumen-astro'
---

<Card as="section" aria-labelledby="profile-title">
  <h2 id="profile-title">Profile</h2>
  <form data-ui-form>
    <Field>
      <Label for="display-name">Display name</Label>
      <Input id="display-name" name="displayName" required />
    </Field>
    <Switch name="productUpdates">Product updates</Switch>
    <Button type="submit">Save changes</Button>
  </form>
  <Alert role="status">Changes are saved after a successful response.</Alert>
</Card>
Step 3

Connect the states your users will actually encounter.

Submitting

Disable duplicate submission, retain field values, and expose a clear progress label.

Saved

Announce success through a status region without moving keyboard focus unexpectedly.

Failed

Keep the entered values, identify the problem, and leave a direct path to retry.

Step 4

Verify behavior, not just appearance.

  1. Keyboard

    Reach every control, see focus, submit the form, and recover from invalid input without a pointer.

  2. Screen reader

    Confirm the section heading, labels, validation messages, switch state, and save result are announced.

  3. Product states

    Exercise initial, dirty, submitting, success, error, disabled, and destructive states.

  4. Responsive layout

    Test narrow content and text zoom without clipping actions or hiding validation feedback.

Built it?

Show the community what you learned.

Finished products and honest adoption feedback both improve Lumen for the next team.

Submit your project