form
form(
opts?):void
Defined in: components/form.ts:55
An opinionated <form> wrapper that lays its fields out consistently — a clean
single column by default, or a responsive grid — and provides a standard
action bar.
Field components (import(”./textline”).textline et al.) drop straight in as ContentOptions.content. Submission is wired so the browser’s native validation runs, but the page never reloads.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Example
Section titled “Example”const $user = A.proxy({name: "Darth", email: "d.vader@example.com"});S.form({ submit: () => save(), content: () => { S.textline({ label: "Name", required: true, bind: A.ref($user, "name") }); S.textline({ label: "Email", type: "email", bind: A.ref($user, "email") }); }, actions: () => S.button({ content: "Save", type: "submit" }),});