A list of sections that open under their titles (<.accordion> with <.accordion_item>).
<.accordion id="faq" variant="bordered">
<.accordion_item id="faq-1" title="Accordion Item 1" open>
<p>Lorem ipsum dolor sit amet.</p>
</.accordion_item>
<.accordion_item id="faq-2" title="Accordion Item 2">...</.accordion_item>
</.accordion>
<.accordion id="help" variant="primary" color="warning">...</.accordion>Variants: canvas (default), basic, border-bottom, bordered, divided, primary and
advanced (a :header of your own per item, with the chevron at its end). color tints the
primary style. One section is open at a time; multiple lets them open independently.
The browser owns which sections are open (the LedgerUI.Collapse hook,
priv/static/ledger_ui/hooks/collapse.js); the server's open wins when it changes,
LedgerUI.open/close/toggle("faq-1") work and on_open / on_close push %{"id" => item_id}
when they are event names. The ARIA is rendered by the server: the header is a role="button"
with tabindex="0", aria-expanded and aria-controls, the body a role="region" labelled by
the header; the hook only updates aria-expanded.
Summary
Functions
Attributes
id(:string) (required)variant(:string) - Defaults to"canvas". Must be one of"advanced","basic","border-bottom","bordered","canvas","divided", or"primary".color(:string) - Defaults to"primary". Must be one of"primary","secondary","info","success","warning", or"error".multiple(:boolean) - Defaults tofalse.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
item- A section, its content the body: oneaccordion_item/1, with the id<id>-<position>. Accepts attributes:title(:string)open(:boolean)id(:string)class(:any)
inner_block-accordion_item/1s, after the<:item>s.
Attributes
id(:string) (required)title(:string) - Defaults tonil.open(:boolean) - Defaults tofalse.on_open(:any) - Defaults tonil.on_close(:any) - Defaults tonil.target(:any) - Defaults tonil.toggle_label(:string) - Defaults to"Toggle".class(:any) - Defaults tonil.trigger_class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
headerinner_block