lenards / elm-ui-patternfly / PF4.ExpandableSection

An expandable component that fills the role of a "click to open" section

Definition


type ExpandableSection msg

Opaque ExpandableSectionelement that can produce msg messages

Constructor function

expandableSection : { text : String, content : Element msg, onPress : Maybe msg } -> ExpandableSection msg

Constructs an expandable section given a String for the text, and content to "show" onPress.

The onPress message in this form will allow the handling of the state change using expandSection and collapseSection. This will be the manner of acting until the decision on whether to make this a "stateful" component has been made.

Configuration functions

withDynamicText : { open : String, closed : String } -> ExpandableSection msg -> ExpandableSection msg

Configure the section to have a dynamic text; text that will change when the section is "open", and "closed"

By default, an ExpandableSection will be constructed with a Closed state.

withPressMsg : msg -> ExpandableSection msg -> ExpandableSection msg

Configure the onPress msg produced

State-change functions

expandSection : ExpandableSection msg -> ExpandableSection msg

Requests the state change of the element to an expanded, or open state

collapseSection : ExpandableSection msg -> ExpandableSection msg

Requests the state change of the element to a collapsed, or closed state

Rendering element

toMarkup : ExpandableSection msg -> Element msg

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