Form controls
FormAssist
Wrap a form's fields in <FormAssist> and an assistant elsewhere on the page can read
them and suggest a value for each. A suggestion goes into its control, drawn in violet with a Suggested
tag and buttons to accept or reject it, and the page's own Save or Create posts it.
Usage
Each field needs a name, which is the key a suggestion fills. Choose Suggest values,
then accept or reject each one, or all of them from the bar above the fields. While a suggestion
waits, the form does not submit.
What an assistant cannot touch
A value the person changed is never overwritten. A password, a file and any control given noAI are never reported or filled. A suggestion held by a field that leaves the page, behind
a tab or a closed section, is rejected and the old value comes back.
The controller
activeAssistForm() returns the form to work on: the newest one in an open dialog or
drawer, else the page's form that holds focus, else the page's first. Its controller has label, describe(), suggest(values), acceptAll(), rejectAll() and pending(). A control the kit
does not ship joins the form through assistField().
API
| Prop | Type | Default | Description |
|---|---|---|---|
label required | string | no default | Names the form for whoever fills it, such as "New key". |
class | string | 'flex flex-col gap-4' | Classes on the wrapper. |
children required | Snippet | no default | The form's fields. |