Checkboxes are used to give buyers a binary option. They are commonly used to present terms and conditions.
Unlike most field components, any children passed to this component will be used as the label for the checkbox.
optional = ?
||A unique identifier for the field. When no
||An identifier for the field that is unique within the nearest containing
||Whether the checkbox is active. This prop is an alias for
||Whether the checkbox is active.|
||Whether the checkbox can be changed.|
||An error label to present with the field.|
||A label to use for the field that will be used for buyers using assistive technologies. When provided, any
||A callback that is run whenever the checkbox is changed. This callback is called with a boolean indicating whether the checkbox should now be active or inactive. This component is controlled, so you must store this value in state and reflect it back in the
Best practicesAnchor link to section titled "Best practices"
- Be framed positively: for example, Turn on notifications instead of Turn off notifications.
- Be aware of any legal issues around checkboxes - for example, to comply with GDPR, marketing sign-up checkboxes should always be deselected by default.
- Link to more information or include a subtitle as required to provide more explanation. Don’t rely on tooltips to explain a checkbox.