{"slug":"accordion","name":"Accordion","category":"Layout & Navigation","summary":"A stack of collapsible sections; one or several can be open.","status":"stable","since":"0.1.0","import":"import { Accordion, AccordionItem } from '@elluzion/iv-ui';","usage":["Each `AccordionItem` needs a unique `value`; the parent tracks the open values.","Set `multiple` to keep several panels open at once.","Bind `value` for controlled state, or use `defaultValue` for an uncontrolled accordion."],"props":[{"name":"multiple","type":"boolean","default":"false","description":"Allows several items to stay open at once.","required":false,"bindable":false},{"name":"value","type":"AccordionValue","default":null,"description":"Open item value(s). Bind with `bind:value` for controlled state.","required":false,"bindable":true},{"name":"defaultValue","type":"AccordionValue","default":null,"description":"Item(s) open on first render.","required":false,"bindable":false},{"name":"disabled","type":"boolean","default":"false","description":"Disables interaction and applies the disabled treatment.","required":false,"bindable":false},{"name":"className","type":"string","default":"''","description":"Extra classes merged onto the root element.","required":false,"bindable":false},{"name":"value","type":"string","default":null,"description":"Unique value used by the parent accordion to track this item.","required":true,"bindable":false},{"name":"title","type":"string","default":"''","description":"Trigger text. Use the `trigger` snippet for custom content.","required":false,"bindable":false},{"name":"disabled","type":"boolean","default":"false","description":"Disables interaction and applies the disabled treatment.","required":false,"bindable":false}],"events":[{"name":"change","type":"(e: CustomEvent<{ value: AccordionValue }>) => void","default":null,"description":"Called with `{ value }` after an item opens or closes.","required":false,"bindable":false}],"snippets":[{"name":"children","type":"Snippet","default":null,"description":"Content rendered inside the component.","required":true,"bindable":false},{"name":"children","type":"Snippet","default":null,"description":"Panel content revealed when the item is open.","required":true,"bindable":false},{"name":"trigger","type":"Snippet","default":null,"description":"Custom trigger content replacing the title.","required":false,"bindable":false}],"types":[{"name":"AccordionValue","kind":"type","code":"type AccordionValue = string | string[];","description":"One open item, or several when `multiple` is set."}],"manual":[],"tokens":["--iv_border","--iv_radius","--iv_disabled-opacity","--iv_ease-out","--iv_font-ui","--iv_foreground","--iv_foreground-dim","--iv_leading-base","--iv_outline-width","--iv_spacing-lg","--iv_spacing-xl","--iv_surface-overlay","--iv_surface-raised","--iv_text-body","--iv_text-btn","--iv_transition-fast"],"cssHooks":["iv-accordion","iv-disabled","iv-chevron","iv-item","iv-open","iv-panel","iv-trigger","iv-trigger-label"],"accessibility":{"keyboard":[["Tab","Moves focus to the next trigger."],["Enter / Space","Opens or closes the focused section."]],"notes":["Triggers are native buttons with `aria-expanded` and `aria-controls`.","Panels use `role=\"region\"` and are labelled by their trigger.","Opening and closing respects `prefers-reduced-motion`."]},"related":[{"title":"Collapsible","summary":"A single section that expands to reveal content.","url":"/components/collapsible","kind":"Component"},{"title":"Tabs","summary":"Switches between panels that share one context.","url":"/components/tabs","kind":"Component"},{"title":"Card","summary":"A bordered surface for grouped content and actions.","url":"/components/card","kind":"Component"},{"title":"Separator","summary":"A hairline rule that separates content.","url":"/components/separator","kind":"Component"}],"examples":[{"id":"single","title":"Single","description":"Opening one section closes the previous one.","code":"<script lang=\"ts\">\n\timport { Accordion, AccordionItem } from '@elluzion/iv-ui';\n</script>\n\n<Accordion defaultValue=\"runtime\">\n\t<AccordionItem value=\"runtime\" title=\"Runtime\">\n\t\t<p>Node 22 on Linux, with the edge cache in front of every request.</p>\n\t</AccordionItem>\n\t<AccordionItem value=\"build\" title=\"Build\">\n\t\t<p>Static output is prerendered; the rest is bundled on demand.</p>\n\t</AccordionItem>\n\t<AccordionItem value=\"regions\" title=\"Regions\">\n\t\t<p>Three regions, one primary and two read replicas.</p>\n\t</AccordionItem>\n</Accordion>"},{"id":"multiple","title":"Multiple","description":"`multiple` keeps every opened section open.","code":"<script lang=\"ts\">\n\timport { Accordion, AccordionItem } from '@elluzion/iv-ui';\n</script>\n\n<Accordion multiple defaultValue={['runtime', 'regions']}>\n\t<AccordionItem value=\"runtime\" title=\"Runtime\">\n\t\t<p>Node 22 on Linux, with the edge cache in front of every request.</p>\n\t</AccordionItem>\n\t<AccordionItem value=\"build\" title=\"Build\">\n\t\t<p>Static output is prerendered; the rest is bundled on demand.</p>\n\t</AccordionItem>\n\t<AccordionItem value=\"regions\" title=\"Regions\">\n\t\t<p>Three regions, one primary and two read replicas.</p>\n\t</AccordionItem>\n</Accordion>"},{"id":"custom-trigger","title":"Custom trigger","description":"The `trigger` snippet replaces the title content.","code":"<script lang=\"ts\">\n\timport { IconShieldLock } from '@tabler/icons-svelte';\n\timport { Accordion, AccordionItem } from '@elluzion/iv-ui';\n</script>\n\n<Accordion defaultValue=\"access\">\n\t<AccordionItem value=\"access\">\n\t\t{#snippet trigger()}\n\t\t\t<span class=\"trigger\">\n\t\t\t\t<IconShieldLock size={14} />\n\t\t\t\tAccess control\n\t\t\t</span>\n\t\t{/snippet}\n\t\t<p>Roles are inherited from the organization; overrides live on the project.</p>\n\t</AccordionItem>\n\t<AccordionItem value=\"audit\" title=\"Audit log\">\n\t\t<p>Every privileged action is recorded with the actor and the request id.</p>\n\t</AccordionItem>\n</Accordion>\n\n<style>\n\t.trigger {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: var(--iv_spacing-sm);\n\t}\n</style>"}],"markdown":"/components/accordion.md","page":"/components/accordion"}