Skip to main content

Form

A <form> element that stacks its children vertically with a configurable gap. Wrap any combination of form controls to produce consistent vertical rhythm without writing per-page layout CSS.

Usage​

When to use

  • Any <form> that submits one or more form controls
  • Wrapping a stack of form controls that need consistent vertical rhythm
  • As the outer element for sign-up, contact, login, and similar flows

When not to use

  • Inline filter chips with no submit step - use a plain wrapper or filter
  • A single search field in a header bar - use search
  • Decorative groupings inside an existing form - use fieldset

Do

  • Set method and action so the form still submits without JavaScript
  • Use the size values (sm, lg) when the form sits inside a dense surface or a hero
  • Group related controls inside fieldset for shared semantics

Don't

  • Don't wrap controls from multiple unrelated submissions in a single form
  • Don't disable native HTML validation unless a custom validator runs in its place
  • Don't override the form gap with per-instance margins - use the size values instead

API​

Slots​

SlotRequiredDescription
contentYesHTML string for the inner content of the form.

Props​

PropTypeDefaultDescription
actionstring-URL where form data is submitted.
methodEnum: get, postgetHTTP method.
enctypeEnum: application/x-www-form-urlencoded, multipart/form-data, text/plain-Encoding type for the submitted form data.
namestring-Name of the form.
targetstring-Response target: _self, _blank, _parent, _top, or a named browsing context.
autocompleteEnum: on, off-Controls browser autofill behavior.
use_novalidateboolean-Skips native HTML validation on submit.
classesarray-Additional CSS class words merged into the root element.
attributesobject-Additional HTML attributes spread on the root element.

Classes​

ClassCapabilityDefaultDescription
.subtleEmphasis-Lower emphasis; a muted, quieter weight.
.neutralEmphasisYesDefault emphasis; the standard weight at balanced contrast.
.accentEmphasis-Higher emphasis; a stronger, louder weight.
.smSize-Small.
.mdSizeYesMedium.
.lgSize-Large.
.fluidLayout-Full-width, no max-width.
.containedLayoutYesConstrained to a max-width.

Accessibility​

  • WCAG 2.2 AA
  • Native <form> semantics so assistive tech recognizes the submission boundary
  • Each form control inside keeps its own label, helper text, and error association - form does not interfere with control semantics
  • Vertical rhythm gap is honored by reduced-motion users (no animation involved)