prongs
GitHub

layout.form

A form: renders <form> and stacks its fields

Component

Renders

<form>

Profile

Comes from

starter
Read https://www.prongs.dev/docs/intents/layout/form.md and tell me whether layout.form fits what I am building.

Example

Preview
<Layout intent="layout.form" onSubmit={save}>
<Field intent="field.email" label="Email" />
<Layout intent="layout.actions">
<Action intent="action.submit" verb="save">Save changes</Action>
</Layout>
</Layout>

Connections

Choosing between neighbours

  • If it is

    Use

  • A form: renders <form> and stacks its fields

    layout.form
  • A single field with its label and messages

    layout.field

For registry authors

Starter intents. These are the intents prongs add puts in your registry, shown in this site’s theme. Yours are your own registry.ts: rename, restyle and add to them, and see them with prongs add gallery.

What this intent is built from and its entry in components/prongs/registry.ts. You only need this to change how it looks or to add an intent like it.

How layout.form resolves, and its definition

Each layer adds to the one before it; a later class wins over an earlier one that sets the same thing.

  • arrange.stack

    Children in a column, free to shrink inside a row or grid

    flex min-w-0 flex-col
  • layout.form

    A form: renders <form> and stacks its fields

    gap-4
Final classes
flex min-w-0 flex-col gap-4
Definition
TS
'layout.form': {
kind: 'semantic',
description: 'A form: renders <form> and stacks its fields',
refs: ['arrange.stack'],
binding: { element: 'form', classes: 'gap-4' },
notFor: [
{
context: 'a single field with its label and messages',
instead: 'layout.field',
},
],
},