Checkboxes allow the user to select one or more items from a set.
This module implements CSS-only checkboxes without state.
In your application install:
npm install "@material/checkbox"In your Sass file import:
@import "@material/checkbox/mdc-checkbox";import Html
import Html.Attributes as Attr
import Material.Checkbox as Checkbox
import Material.FormField as FormField
import Material.Options as Options
FormField.view [ Options.onClick Toggle ]
[ Checkbox.view
[ Options.id "my-checkbox"
, Checkbox.checked <| Just True
]
[]
, Html.label
[ Attr.for "my-checkbox" ]
[ Html.text "My checkbox" ]
]Indicates whether a checkbox is checked.
`Nothing` puts a checkbox in an indeterminate state which is not checked
but visualized with a flat bar. The indeterminate state should be used on
parent checkboxes where not all child checkboxes are checked.Indicates whether the user can interact with a checkbox.
Renders a checkbox without label. Childs are ignored.