mirror of
https://github.com/hunvreus/basecoat.git
synced 2026-11-13 05:38:18 +00:00
3.4 KiB
3.4 KiB
templateEngineOverride, layout, title, description, toc
| templateEngineOverride | layout | title | description | toc | |||||
|---|---|---|---|---|---|---|---|---|---|
| njk | layouts/page.njk | Accordion | A vertically stacked set of interactive headings that each reveal a section of content. |
|
{% from "macros/code_preview.njk" import code_preview %}
{% lucide "circle-alert" %}
There is no dedicated Accordion component in Basecoat.
{% set code %}
Is it accessible?
{% lucide "chevron-down", { "class": "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200 group-open:rotate-180" } %}
Yes. It adheres to the WAI-ARIA design pattern.
Is it styled?
{% lucide "chevron-down", { "class": "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200 group-open:rotate-180" } %}
Yes. It comes with default styles that matches the other components' aesthetic.
Is it animated?
{% lucide "chevron-down", { "class": "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200 group-open:rotate-180" } %}
Yes. It's animated by default, but you can disable it if you prefer.
Usage
Basecoat already animates <details> elements by default. The example add some Tailwind CSS utility classes for style and a bit of vanilla JavaScript to handle the open/close state.