NoRedInk/noredink-ui/20.3.0

NOTE: the latest version is 35.9.3

Nri.Ui.Checkbox.V6

Patch changes

Changes from V5:

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

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

viewWithLabel : Model msg -> Html msg

Shows a checkbox and its label text

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.

viewIcon : List Style -> Svg -> Html msg