Accordion

ExoUI is a headless component library for Phoenix LiveView. All components emit semantic HTML with data-exo attributes.
<.accordion id="accordion-single-default">
  <:item title="What is ExoUI?" open>ExoUI is a headless component library for Phoenix LiveView. All components emit semantic HTML with data-exo attributes.</:item>
  <:item title="How do I style components?">Import the exo.css theme file, or write your own CSS targeting the data-exo attributes.</:item>
  <:item title="Does it support dark mode?">Yes. The default theme includes dark mode via the data-theme attribute.</:item>
</.accordion>
ExoUI is a headless component library for Phoenix LiveView. All components emit semantic HTML with data-exo attributes.
Import the exo.css theme file, or write your own CSS targeting the data-exo attributes.
<.accordion id="accordion-single-multiple" type="multiple">
  <:item title="What is ExoUI?" open>ExoUI is a headless component library for Phoenix LiveView. All components emit semantic HTML with data-exo attributes.</:item>
  <:item title="How do I style components?" open>Import the exo.css theme file, or write your own CSS targeting the data-exo attributes.</:item>
  <:item title="Does it support dark mode?">Yes. The default theme includes dark mode via the data-theme attribute.</:item>
</.accordion>
ExoUI is a headless component library for Phoenix LiveView. All components emit semantic HTML with data-exo attributes.
<.accordion id="accordion-single-plus" variant="plus">
  <:item title="What is ExoUI?" open>ExoUI is a headless component library for Phoenix LiveView. All components emit semantic HTML with data-exo attributes.</:item>
  <:item title="How do I style components?">Import the exo.css theme file, or write your own CSS targeting the data-exo attributes.</:item>
  <:item title="Does it support dark mode?">Yes. The default theme includes dark mode via the data-theme attribute.</:item>
</.accordion>
ExoUI is a headless component library for Phoenix LiveView. All components emit semantic HTML with data-exo attributes.
<.accordion id="accordion-single-joined" joined>
  <:item title="What is ExoUI?" open>ExoUI is a headless component library for Phoenix LiveView. All components emit semantic HTML with data-exo attributes.</:item>
  <:item title="How do I style components?">Import the exo.css theme file, or write your own CSS targeting the data-exo attributes.</:item>
  <:item title="Does it support dark mode?">Yes. The default theme includes dark mode via the data-theme attribute.</:item>
</.accordion>
You can open and close this item.
<.accordion id="accordion-single-disabled-items">
  <:item title="This item works normally" open>You can open and close this item.</:item>
  <:item title="This item is disabled" disabled>You should not be able to see this.</:item>
  <:item title="This also works">Another normal item.</:item>
</.accordion>
Once opened, you can't close this; only switch to another item.
<.accordion id="accordion-single-non-collapsible">
  <:item title="Always one open" open>Once opened, you can't close this; only switch to another item.</:item>
  <:item title="Click me to switch">Now the previous item closed and this one opened.</:item>
  <:item title="Or click me">Same behavior: always exactly one open.</:item>
</.accordion>