Form

Form

Takes a block

Groups controls; on submit runs when it is submitted, and the page never navigates away.

Form(bind: …, show: …) { … }

Example

state name = "" Form(bind: form) { on submit { log(name) } Input(bind: name, label: "Name").required Button("Save", type: .submit, disabled: !form.valid).primary }

Renders with the class wf-form, stable across releases, so a stylesheet may target it.

Props of Form
Prop Type Meaning
bind: State

A handle on the form: form.valid, form.errors, form.values by field name, form.reset(), form.apply(serverErrors)

show: .onBlur .onSubmit .live

When a validate block's message is shown

Attribute families: global, aria, data, form. Plus the universal props on every element: animate:, exit:, speed:, class:, ref:.