NoRedInk/noredink-ui/7.8.0

NOTE: the latest version is 35.9.3

Nri.Ui.Checkbox.V3

type alias Model msg =
{ identifier : String
, label : String
, setterMsg : Bool -> msg
, selected : IsSelected
, disabled : Bool
, theme : Theme
, noOpMsg : msg
}
type Theme
= Square
| Locked
= Selected
| NotSelected
| PartiallySelected
= Selected --  Checked (rendered with a checkmark)
| NotSelected -- Not Checked (rendered blank)
| PartiallySelected -- Indeterminate (rendered dash)
view : Assets a -> Model msg -> Html msg

Shows a checkbox (the label is only used for accessibility hints)

viewWithLabel : Assets a -> Model msg -> Html msg

Shows a checkbox and its label text

type alias Assets r =
{ r
| checkboxUnchecked_svg : Asset
, checkboxChecked_svg : Asset
, checkboxCheckedPartially_svg : Asset
, checkboxLockOnInside_svg : Asset
}

The assets used in this module.

If your selectedness is always selected or not selected, you will likely store that state as a Bool in your model. selectedFromBool lets you easily convert that into an IsSelected value for use with Nri.Ui.Checkbox.

Modules