An expandable component that fills the role of an accordian
Opaque Accordion
element that can produce msg
messages
Opaque AccordionItem
element that can produce msg
messages
accordion : (Msg -> msg) -> List ( String, Element msg ) -> Accordion msg
Constructs an accordian given a list of (title, content)
and a message
mapper function.
The msgMapper
needs to take a PF4.Accordian.Msg
and transform it into
to the msg
of your Elm application.
accordionItem : { title : String, content : Element msg } -> AccordionItem msg
Constructs an accordion item given a title
and an Element msg
as content
defaultState : State
Constructs a default state with the default behavior
The default behavior is "Single Expand".
Only a single accordion can be open at a given time.
singleExpandState : State
Constructs a state with behavior of "Single Expand"
Only a single accordion can be open at a given time.
multipleExpandState : State
Constructs a state with behavior of "Multiple Expand"
Each accordion item clicked on will be opened. An open accordion item clicked on will close.
Behavior
Opaque State
representation of the Accordion
.
To create a State
, use one of the provided
Internal Accordion.Msg type for handling statefulness
update : Msg -> State -> State
Handles updating the state
given the Msg
toMarkupFor : State -> Accordion msg -> Element msg
Using the state and component's options to render as an Element msg
Stateful PF4 components will have a toMarkupFor
, as an "markup for a
particular state", instead of the toMarkup
used for stateless
components.