Forms
Focus Guard Form
Focus Guard Form: A form that, on a failed submit, cancels the submission, moves keyboard focus straight to the first invalid field, and announces the problem for screen reader users.
Using Focus Guard Form
Focus Guard Form uses the card preview frame with a light/dark theme setting.
Customize the preview
These controls are passed to the demo. Defaults and limits describe the preview; consult the implementation for its full prop API.
| Control | Type | Default | Preview limits |
|---|---|---|---|
submitLabel | text | Create account | Up to 24 characters |
accentColor | color | #7C5CFF | No additional limit in the metadata. |
requireAll | boolean | true | No additional limit in the metadata. |
Which frameworks are available for Focus Guard Form?
Focus Guard Form is available for React, Vue, Svelte, Astro, HTML. The live preview uses React; the source observations below apply to index.tsx. Check the selected port before relying on the same interactions.
What does Focus Guard Form depend on?
The React metadata lists these npm dependencies beyond React: motion, clsx, tailwind-merge.
What accessibility details are visible in Focus Guard Form?
The React source for Focus Guard Form includes: native elements (button, label); attributes and handlers (aria-describedby, aria-hidden, aria-invalid, aria-live); explicit roles (status). These are source observations. Verify accessible names, focus order and keyboard behavior in the composed page.
How does Focus Guard Form handle reduced motion?
Focus Guard Form reads the motion preference in its React source through useReducedMotion(). Preference-dependent expressions in index.tsx: reduced ? { duration: 0 } : { duration: 0.16 }; reduced ? { duration: 0 } : { duration: 0.18 }; reduced ? { duration: 0 } : { duration: 0.22, ease: [0.2, 0.8, 0.2, 1] }. Check the full implementation, shared styles and selected port with reduced motion enabled; these observations do not establish that every animation stops.