AsterUIDocsv1.0.2

Docs / Component reference

Form, FormSection & FormActions

Group related fields and put the save action beside them. The caller decides how to validate and submit the values.

Form example

Install

sh
npx @fierst/ui@1.0.2 add form

Registry dependencies: theme.

Exports from ./ui/form: Form, FormSection, FormActions.

Download the registry source for form 1.0.2.

API contracts

ts
export function Form({
  onSubmit,
  class: extraClass,
  children,
}: {
  onSubmit?: (e: SubmitEvent) => void;
  class?: string;
  children?: View;
})

export function FormSection({
  title,
  description,
  layout = 'split',
  class: extraClass,
  children,
}: {
  title: string;
  description?: string;
  layout?: 'split' | 'stacked';
  class?: string;
  children?: View;
})

export function FormActions(props: { class?: string; children?: View })