--- layout: '@/layouts/Doc.astro' title: Accordion --- import Example from '@/components/Example.astro' import accordionStyle from '../../../../../packages/theme-custom/src/components/accordion.css?raw' Displays an accordion Open me

Accordion content

`} /> ## Import ```css @import '@webtui/css/components/accordion.css'; ``` ## Usage ```html
Summary title

Accordion content

``` ## Examples ### Nesting Parent
Favorite Child
Grandchild

Grandchild content

Normal Child

Normal Child content

`} /> ## Reference ### Extending To extend the Badge stylesheet, define a CSS rule on the `components` layer ```css @layer components { details[is-~='accordion'] { &[variant-='directory'] { summary::before { content: '> '; } &[open] summary::before { content: 'v '; } } /* ... */ } } ``` ### Scope - All `
` elements with the `is-~="accordion"` selector ```css details[is-~='accordion'] { /* ... */ } ```