Creates an Accordion component by using predefined Html syntax.
#Configuration
Represents the state of the component. Values passed in are susceptible to change.
#Configuration Helpers
Returns the configuration for a Base accordion skin.
--
...
type alias Slug =
String
type Msg =
Toggled Slug Bool
myAccordionConfig : `Accordion.Config`
myAccordionConfig =
let
slug =
"my_accordion_slug"
tagger =
Toggled
in
Accordion.baseConfig slug tagger
...The same as baseConfig but with a Light skin.
The same as baseConfig but with a Dark skin.
Returns the basic state of the component.
-- Create a new `Accordion.State`
...
myAccordionState : Accordion.State
myAccordionState =
let
isOpen =
False
title =
"My title"
content =
[ text "Lorem ipsum dolor sit amet." ]
in
Accordion.state isOpen title content
...#Helpers
Opens the Accordion to reveal it's content.
--
...
updatedAccordionState = Accordion.open myAccordionState
...Closes the Accordion to hide it's content.
--
...
updatedAccordionState = Accordion.close myAccordionState
...#Render
Represents the static configuration of the component. Values passed in are no more modified by the setter.