Pular para o conteúdo

Checkbox

Este conteúdo não está disponível em sua língua ainda.

The Checkbox component is a form control that allows users to select one or multiple options from a set.
It is typically represented as a small square box that can be checked or unchecked.

  • Multiple selection: Users can select multiple options independently.
  • Custom colors: Supports different visual styles using Constants.statusColors or custom colors.
  • Disabled state: Prevents user interaction when needed.
  • Accessible: Includes proper labels for screen readers.

PropTypeDefaultDescription
labelstring""Text label displayed next to the checkbox.
checkedbooleanfalseDetermines if the checkbox is initially checked.
disabledbooleanfalseDisables user interaction with the checkbox.
colorstring"primary"Sets the color of the checkbox. Use Constants.statusColors or "secondary".
  • Use labels to make checkboxes accessible.
  • Avoid using too many checkboxes in a single form for better UX.
  • Use consistent colors to indicate status or importance.
  • Combine with form validation to ensure required selections are made.