field.checkbox
A yes/no choice that is sent with a form: remember me, agree to terms. Pair with a text.label
Read https://www.prongs.dev/docs/intents/field/checkbox.md and tell me whether field.checkbox fits what I am building.Field intents
Example
<Layout intent="layout.lockup">
<Field intent="field.checkbox" id="remember" />
<Text intent="text.label" as="label" htmlFor="remember">Remember me on this device</Text>
</Layout>Connections
Choosing between neighbours
If it is
Use
A yes/no choice that is sent with a form: remember me, agree to terms. Pair with a text.label
field.checkboxA setting that takes effect immediately
field.switchA choice that waits for a submit button
rather thanfield.switchfield.checkbox
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 field.checkbox 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.
input.checkSmall square checkbox
h-4 w-4 shrink-0 cursor-pointer accent-primary
field.checkboxA yes/no choice that is sent with a form: remember me, agree to terms. Pair with a text.label
h-4 w-4 shrink-0 cursor-pointer accent-primary
{ type: 'checkbox' }'field.checkbox': {
kind: 'semantic',
description: 'A yes/no choice that is sent with a form: remember me, agree to terms. Pair with a text.label',
refs: ['input.check'],
binding: { behavior: { type: 'checkbox' } },
notFor: [
{
context: 'a setting that takes effect immediately',
instead: 'field.switch',
},
],
},