field.checkbox
A yes/no choice that is sent with a form: remember me, agree to terms. Pair with a text.label
Field intents
Example
<Field intent="field.checkbox" id="checkbox" name="checkbox" />Choosing between neighbours
Find the row that describes your element, and use the intent on the right.
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.checkboxthis pageA setting that takes effect immediately
field.switchA choice that waits for a submit button
rather thanfield.switchfield.checkboxthis page
Connections
Declared in the registry, both directions. Where an intent is used in your own code is something check and the gallery see; this site has no app code.
- Built from
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',
},
],
},