lenards/elm-ui-patternfly/1.3.0

NOTE: the latest version is 4.0.2

PF4.Radio

A component for presenting mutually exclusive choices

Definition

type Radio option msg

Opaque Radio element that can produce msg messages from a mutually exclusive choices of option

Constructo function

{ onChange : option -> msg
, selected : Maybe option
, label : String
, options :
List
{ value : option
, text : String
}
}
-> Radio option msg

Constructs a Radio from the arguments

Default configuration is to:

  • position of the radio button is to the left
  • the options are rendered "stacked", as a column

Argument Info:

  • label is for given context to all of the option

For example, if a user is choosing between some type of "resources", like the Volumes attached to a virtual machine, the label would be rendered above chooses related to Volumes.

Configuration functions

type alias OptionStatePalette =
{ idle : Color
, focused : Color
, selected : Color
}

A palette rendering the color of the radio button given the possible OptionState definited in elm-ui.

{ idle : Color
, focused : Color
, selected : Color
}
-> Radio option msg
-> Radio option msg

Render with a custom palette

asRow : Radio option msg -> Radio option msg

Configure to render options in a row, left-to-right

asColumn : Radio option msg -> Radio option msg

Configure to render otpions in a column, stacked

Rendering element

toMarkup : Radio option msg -> Element msg

Given the custom type representation, renders as an Element msg.