field.checkbox

A yes/no choice that is sent with a form: remember me, agree to terms. Pair with a text.label

Component

Renders

<input type="checkbox">

Profile

Example

Preview
<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.checkbox this page
  • A setting that takes effect immediately

    field.switch
  • A choice that waits for a submit button

    rather than field.switch
    field.checkbox this 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.

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.check

    Small square checkbox

    h-4 w-4 shrink-0 cursor-pointer accent-primary
  • field.checkbox

    A yes/no choice that is sent with a form: remember me, agree to terms. Pair with a text.label

Final classes
h-4 w-4 shrink-0 cursor-pointer accent-primary
Element behaviour
{ type: 'checkbox' }
Definition
TS
'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',
},
],
},