NoRedInk/noredink-ui/9.5.1

NOTE: the latest version is 35.9.3

Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: Software Heritage not asked yet (this run's --swh-calls were used up); no fork with tag 9.5.1 found (15 same-name repos checked); no cached copy. Use another version.

Details

Nri.Ui.SegmentedControl.V9

type alias Option a =
{ value : a
, icon : Maybe Svg
, label : String
}
type Width
= FitContent
| FillContainer
view : NavConfig a msg -> Html msg
viewSpa : (route -> String) -> NavConfig route msg -> Html msg

Creates a segmented control that supports SPA navigation. You should always use this instead of view when building a SPA and the segmented control options correspond to routes in the SPA.

The first parameter is a function that takes a route and returns the URL of that route.

type alias SelectConfig a msg =
{ onClick : a -> msg
, options : List (Option a)
, selected : Maybe a
, width : Width
}
  • onClick : the message to produce when an option is selected (clicked) by the user
  • options: the list of options available
  • selected: if present, the value of the currently-selected option
  • width: how to size the segmented control
viewSelect : SelectConfig a msg -> Html msg

Creates just the segmented select when you need the ui element itself and not a page control

Changes from V7:

  • remove dependence on Nri.Ui.Icon.V5
  • fix icons overlowing the segmented control