Skip to main content

Checkbox

Give users a clear way to make selections, such as agreeing to terms or choosing multiple items from a list.

Anchor to accessibilityLabel
accessibilityLabel
string

A label used for users using assistive technologies like screen readers. When set, any children or label supplied will not be announced. This can also be used to display a control without a visual label, while still providing context to users using screen readers.

Anchor to checked
checked
boolean
Default: false

Whether the control is active.

Anchor to defaultChecked
defaultChecked
boolean
Default: false

Whether the control is active by default.

Anchor to defaultIndeterminate
defaultIndeterminate
boolean
Default: false
Anchor to details
details
string

Additional text to provide context or guidance for the field. This text is displayed along with the field and its label to offer more information or instructions to the user.

This will also be exposed to screen reader users.

Anchor to disabled
disabled
boolean
Default: false

Disables the field, disallowing any interaction.

Anchor to error
error
string

Indicate an error to the user. The field will be given a specific stylistic treatment to communicate problems that have to be resolved immediately.

string

A unique identifier for the element.

Anchor to indeterminate
indeterminate
boolean
Anchor to label
label
string

Visual content to use as the control label.

string

An identifier for the field that is unique within the nearest containing form.

Anchor to required
required
boolean
Default: false

Whether the field needs a value. This requirement adds semantic value to the field, but it will not cause an error to appear automatically. If you want to present an error when this field is empty, you can do so with the error property.

Anchor to value
value
string

The value used in form data when the checkbox is checked.

Learn more about registering events.

Anchor to change
change
<'input'>
Anchor to input
input
<'input'>
Examples
<s-checkbox
label="Require a confirmation step"
details="Ensure all criteria are met before proceeding"
/>

Preview

  • Use ChoiceList when rendering multiple checkboxes to provide a consistent and accessible selection interface
  • Work independently from each other
  • Be framed positively (e.g., "Publish store" not "Hide store")
  • Always have a label when used to activate or deactivate a setting
  • Be listed in a logical order (alphabetical, numerical, time-based, etc.)

  • Start each option with a capital letter
  • Don't use commas or semicolons at the end of each line
  • Use first person when asking merchants to agree to terms (e.g., "I agree to the Terms of Service")
Was this page helpful?