Checkbox

Checkboxes are used as a list in our forms and signup pages so users can select options of their choice. Users are free to choose how many options to select, from zero to all of them.

As each checkbox is independent, this means that additional checkboxes do not affect any other selections… or planets.

Checkbox

State
@user_changeset = #Ecto.Changeset<
  action: nil,
  changes: %{agrees_to_terms_of_service: false},
  errors: [
    agrees_to_terms_of_service: {"please accept terms of service",
     [validation: :inclusion, enum: [true]]}
  ],
  data: #MoonWeb.Pages.Tutorials.AddDataUsingForm.User<>,
  valid?: false
>

No Label

Disabled

Readonly

Props
Name Type Required Default Description
checked boolean false false Preset value for checkbox state
disabled boolean false false Checkbox disabled state
readonly boolean false false Checkbox isn't disabled but its value can't be changed
field atom true - Field name for the inner input form control
#slot element true - Label for the control