AhaSlides Design
v0.52.0React · Vue · Lit

Components · Data Entry

Form

A labelled, validated set of fields — sign-in, settings, create dialogs — rendered through the shared Form.

Examples

API

PropTypeDefaultNotes
layoutvertical | horizontal | inlineverticalLabel placement
sizesmall | default | largedefaultControl height for every field (24 / 32 / 40)
fieldsFormItem[][]name / label / rules / control per row
requiredMarkboolean | 'optional'trueShow the required asterisk (or mark optional fields instead)
validateStatuserror | warning | success | validatingPer-Form.Item validation state — coloured border + help text
initialValuesobjectSeed values
onFinish(values) => voidFires on a valid submit
disabledbooleanfalseDisables the whole form

Install

# .npmrc — once: point the @ahaslides-product scope at GitHub Packages
@ahaslides-product:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}   # a GitHub token with read:packages

npm i @ahaslides-product/design
import '@ahaslides-product/design/tokens.css';   // once, at the app root
import '@ahaslides-product/design/form-theme';   // registers <form>

Agent feed for this component (absolute, fetchable anywhere): form.agent.json · form.md · form.llms.txt

When to use

When to use
  • Form — two or more related fields submitted together, with validation
  • a single Input/Select — one value that applies on its own — no submit step
  • Settings pattern — a settings surface — see the Settings pattern for grouping and spacing
Label every field with a noun phrase above the control (vertical layout reads best on narrow surfaces). Validate on blur and on submit; show the error below the field with how to fix it. One primary submit per form.
Surfaces
editor dashboard settings

Spec

Controls height 32 · radius 8 · 1px #E3E3E3 border · Label #4A4A4A, above the field (vertical layout) · Submit primary Button #6A1EBB · Error #F5222D border + message below the field · Item gap 20px between items · Size control height 24 (small) · 32 (default) · 40 (large) · Validation error / warning / success — coloured border + help text