NoRedInk/noredink-ui/6.29.0

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 6.29.0 found (15 same-name repos checked); no cached copy. Use another version.

Details

Nri.Ui.SegmentedControl.V7

type alias Config a msg =
{ onClick : a -> msg
, options : List (Option a)
, selected : a
, width : Width
, content : Html msg
}
  • onClick : the message to produce when an option is selected (clicked) by the user
  • options: the list of options available
  • selected: the value of the currently-selected option
  • width: how to size the segmented control
  • content: the panel content for the selected option
type alias Icon =
{ alt : String
, icon : IconType
}
type alias Option a =
{ value : a
, icon : Maybe Icon
, label : String
}
type Width
= FitContent
| FillContainer
view : Config a msg -> Html msg
viewSpa : (route -> String) -> Config 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.