Files
WorkRoot-WRNexusJSComponent/app/pages/components/accordion.wrn
T

499 lines
43 KiB
Plaintext

// Generated by scripts/generate-showcase.mjs. Do not edit directly.
page AccordionDetail {
layout = "showcase"
state playground_size = ctx.url.searchParams.get("pg_size") ?? "default"
state playground_color = ctx.url.searchParams.get("pg_color") ?? "primary"
state playground_variant = ctx.url.searchParams.get("pg_variant") ?? "default"
state playground_class = ctx.url.searchParams.get("pg_class") ?? ""
state playground_id = ctx.url.searchParams.get("pg_id") ?? "accordion-example-1"
state playground_items = ctx.url.searchParams.get("pg_items") ?? "[\n {\n \"value\": \"first\",\n \"label\": \"Accordion #1\",\n \"content\": \"This is the item's accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.\"\n },\n {\n \"value\": \"second\",\n \"label\": \"Accordion #2\",\n \"content\": \"This is the item's accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.\"\n },\n {\n \"value\": \"third\",\n \"label\": \"Accordion #3\",\n \"content\": \"This is the item's accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.\"\n }\n]"
state playground_defaultOpen = ctx.url.searchParams.get("pg_defaultOpen") ?? "[\n \"first\"\n]"
state playground_multiple = ctx.url.searchParams.get("pg_multiple") ?? "false"
state playground_alwaysOpen = ctx.url.searchParams.get("pg_alwaysOpen") ?? "false"
state playground_disabled = ctx.url.searchParams.get("pg_disabled") ?? "false"
state playground_indicator = ctx.url.searchParams.get("pg_indicator") ?? "plus"
state playground_indicatorPosition = ctx.url.searchParams.get("pg_indicatorPosition") ?? "start"
state playground_showIndicator = ctx.url.searchParams.get("pg_showIndicator") ?? "true"
state playground_bordered = ctx.url.searchParams.get("pg_bordered") ?? "false"
state playground_separated = ctx.url.searchParams.get("pg_separated") ?? "false"
state playground_flush = ctx.url.searchParams.get("pg_flush") ?? "false"
state playground_contentItalic = ctx.url.searchParams.get("pg_contentItalic") ?? "true"
seo {
title = "Accordion"
description = "Theme-aware, responsive accordion component."
}
view {
<nav class="docs-breadcrumbs" aria-label="Breadcrumb">
<a href="/">Components</a><span aria-hidden="true">/</span><a href="/base">Base</a><span aria-hidden="true">/</span><span>Accordion</span>
</nav>
<header class="detail-hero">
<div class="detail-hero-copy">
<span class="showcase-eyebrow">Base component</span>
<h1>Accordion</h1>
<p>Theme-aware, responsive accordion component.</p>
<div class="detail-badges"><span>17 props</span><span>0 slots</span><span>3 events</span><span>Theme ready</span><span>Responsive</span></div>
</div>
<div class="detail-hero-icon"><span class="icon-[lucide--component] size-10" aria-hidden="true"></span></div>
</header>
<section id="playground" class="detail-section playground-section" data-playground data-playground-component="Accordion" data-playground-public-tag="true" data-playground-has-slot="false">
<div class="detail-section-heading"><span>Interactive playground</span><h2>Configure Accordion</h2><p>Change any prop and inspect the server-rendered component immediately.</p></div>
<div class="playground-workbench">
<div class="playground-preview">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="playground-preview-source" data-playground-preview><div data-component="Accordion" size="{playground_size}" color="{playground_color}" variant="{playground_variant}" class="{playground_class}" id="{playground_id}" items="{playground_items}" defaultOpen="{playground_defaultOpen}" multiple="{playground_multiple}" alwaysOpen="{playground_alwaysOpen}" disabled="{playground_disabled}" indicator="{playground_indicator}" indicatorPosition="{playground_indicatorPosition}" showIndicator="{playground_showIndicator}" bordered="{playground_bordered}" separated="{playground_separated}" flush="{playground_flush}" contentItalic="{playground_contentItalic}"></div></div>
<section class="playground-code" aria-label="Current component code">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component code</span><button type="button" data-playground-copy><span class="icon-[lucide--copy] size-4" aria-hidden="true"></span>Copy</button></header>
<pre><code data-playground-code>&lt;Accordion
id="accordion-example-1"
items='[
&#123;
"value": "first",
"label": "Accordion #1",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "second",
"label": "Accordion #2",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "third",
"label": "Accordion #3",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;
]'
defaultOpen='[
"first"
]'
contentItalic="true"
/&gt;</code></pre>
</section>
<div class="playground-status" data-playground-status aria-live="polite"></div>
</div>
<form class="playground-controls" data-playground-form>
<header><div><span>Component props</span><strong>17 controls</strong></div><button type="reset"><span class="icon-[lucide--rotate-ccw] size-4" aria-hidden="true"></span>Reset</button></header>
<div class="playground-fields"><label class="playground-field" for="playground-accordion-size"><span><strong>size</strong><small>string</small></span><select id="playground-accordion-size" name="pg_size"><option value="default" selected>default</option><option value="xs">xs</option><option value="sm">sm</option><option value="md">md</option><option value="lg">lg</option><option value="xl">xl</option><option value="icon">icon</option><option value="icon-xs">icon-xs</option><option value="icon-sm">icon-sm</option><option value="icon-lg">icon-lg</option></select></label><label class="playground-field" for="playground-accordion-color"><span><strong>color</strong><small>string</small></span><select id="playground-accordion-color" name="pg_color"><option value="primary" selected>primary</option><option value="secondary">secondary</option><option value="success">success</option><option value="warning">warning</option><option value="danger">danger</option><option value="info">info</option></select></label><label class="playground-field" for="playground-accordion-variant"><span><strong>variant</strong><small>string</small></span><select id="playground-accordion-variant" name="pg_variant"><option value="default" selected>default</option><option value="outline">outline</option><option value="secondary">secondary</option><option value="ghost">ghost</option><option value="destructive">destructive</option><option value="link">link</option></select></label><label class="playground-field" for="playground-accordion-class"><span><strong>class</strong><small>string</small></span><input id="playground-accordion-class" name="pg_class" type="text" value="" /></label><label class="playground-field" for="playground-accordion-id"><span><strong>id</strong><small>string</small></span><input id="playground-accordion-id" name="pg_id" type="text" value="accordion-example-1" /></label><label class="playground-field" for="playground-accordion-items"><span><strong>items</strong><small>string</small></span><textarea id="playground-accordion-items" name="pg_items" rows="5" spellcheck="false" data-playground-json>[
{
"value": "first",
"label": "Accordion #1",
"content": "This is the item's accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
},
{
"value": "second",
"label": "Accordion #2",
"content": "This is the item's accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
},
{
"value": "third",
"label": "Accordion #3",
"content": "This is the item's accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
}
]</textarea><em data-playground-error></em></label><label class="playground-field" for="playground-accordion-defaultOpen"><span><strong>default Open</strong><small>string</small></span><textarea id="playground-accordion-defaultOpen" name="pg_defaultOpen" rows="5" spellcheck="false" data-playground-json>[
"first"
]</textarea><em data-playground-error></em></label><label class="playground-toggle" for="playground-accordion-multiple"><span><strong>multiple</strong><small>boolean</small></span><input id="playground-accordion-multiple" name="pg_multiple" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-accordion-alwaysOpen"><span><strong>always Open</strong><small>boolean</small></span><input id="playground-accordion-alwaysOpen" name="pg_alwaysOpen" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-accordion-disabled"><span><strong>disabled</strong><small>boolean</small></span><input id="playground-accordion-disabled" name="pg_disabled" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-field" for="playground-accordion-indicator"><span><strong>indicator</strong><small>string</small></span><input id="playground-accordion-indicator" name="pg_indicator" type="text" value="plus" /></label><label class="playground-field" for="playground-accordion-indicatorPosition"><span><strong>indicator Position</strong><small>string</small></span><select id="playground-accordion-indicatorPosition" name="pg_indicatorPosition"><option value="start" selected>start</option><option value="end">end</option></select></label><label class="playground-toggle" for="playground-accordion-showIndicator"><span><strong>show Indicator</strong><small>boolean</small></span><input id="playground-accordion-showIndicator" name="pg_showIndicator" type="checkbox" value="true" checked data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-accordion-bordered"><span><strong>bordered</strong><small>boolean</small></span><input id="playground-accordion-bordered" name="pg_bordered" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-accordion-separated"><span><strong>separated</strong><small>boolean</small></span><input id="playground-accordion-separated" name="pg_separated" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-accordion-flush"><span><strong>flush</strong><small>boolean</small></span><input id="playground-accordion-flush" name="pg_flush" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-accordion-contentItalic"><span><strong>content Italic</strong><small>boolean</small></span><input id="playground-accordion-contentItalic" name="pg_contentItalic" type="checkbox" value="true" checked data-playground-boolean /><i aria-hidden="true"></i></label></div>
</form>
</div>
</section>
<div class="detail-layout">
<main class="detail-content">
<section class="detail-section"><div class="detail-section-heading"><span>Live examples</span><h2>Designed for real product surfaces</h2><p>Compare configurations and resize the browser to check responsive behavior.</p></div><div class="demo-list">
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Basic usage</span><h2>Default accordion</h2><p>Open one section at a time with a clear plus and minus indicator.</p></div>
<span class="demo-case-number">01</span>
</header>
<div class="demo-workbench">
<div id="accordion-demo-1" class="demo-canvas demo-canvas--1">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Accordion" size="default" color="primary" id="accordion-example-1" items="[{&quot;value&quot;:&quot;first&quot;,&quot;label&quot;:&quot;Accordion #1&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;},{&quot;value&quot;:&quot;second&quot;,&quot;label&quot;:&quot;Accordion #2&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;},{&quot;value&quot;:&quot;third&quot;,&quot;label&quot;:&quot;Accordion #3&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;}]" defaultOpen="[&quot;first&quot;]" contentItalic="true"></div></div>
</div>
<section class="demo-code" aria-label="Default accordion usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Accordion
id="accordion-example-1"
items='[
&#123;
"value": "first",
"label": "Accordion #1",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "second",
"label": "Accordion #2",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "third",
"label": "Accordion #3",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;
]'
defaultOpen='[
"first"
]'
contentItalic="true"
/&gt;</code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Behavior</span><h2>Always open</h2><p>Allow several content sections to remain expanded at the same time.</p></div>
<span class="demo-case-number">02</span>
</header>
<div class="demo-workbench">
<div id="accordion-demo-2" class="demo-canvas demo-canvas--2">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Accordion" size="default" color="primary" id="accordion-example-2" items="[{&quot;value&quot;:&quot;first&quot;,&quot;label&quot;:&quot;Accordion #1&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;},{&quot;value&quot;:&quot;second&quot;,&quot;label&quot;:&quot;Accordion #2&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;},{&quot;value&quot;:&quot;third&quot;,&quot;label&quot;:&quot;Accordion #3&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;}]" defaultOpen="[&quot;first&quot;,&quot;second&quot;]" alwaysOpen="true" contentItalic="true"></div></div>
</div>
<section class="demo-code" aria-label="Always open usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Accordion
id="accordion-example-2"
items='[
&#123;
"value": "first",
"label": "Accordion #1",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "second",
"label": "Accordion #2",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "third",
"label": "Accordion #3",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;
]'
defaultOpen='[
"first",
"second"
]'
alwaysOpen="true"
contentItalic="true"
/&gt;</code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Composition</span><h2>Nested accordion</h2><p>Place a coordinated secondary accordion inside an expanded parent section.</p></div>
<span class="demo-case-number">03</span>
</header>
<div class="demo-workbench">
<div id="accordion-demo-3" class="demo-canvas demo-canvas--3">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Accordion" size="default" color="primary" id="accordion-example-3" items="[{&quot;value&quot;:&quot;first&quot;,&quot;label&quot;:&quot;Accordion #1&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;,&quot;children&quot;:[{&quot;value&quot;:&quot;sub-first&quot;,&quot;label&quot;:&quot;Sub accordion #1&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;},{&quot;value&quot;:&quot;sub-second&quot;,&quot;label&quot;:&quot;Sub accordion #2&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;},{&quot;value&quot;:&quot;sub-third&quot;,&quot;label&quot;:&quot;Sub accordion #3&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;}]},{&quot;value&quot;:&quot;second&quot;,&quot;label&quot;:&quot;Accordion #2&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;},{&quot;value&quot;:&quot;third&quot;,&quot;label&quot;:&quot;Accordion #3&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;}]" defaultOpen="[&quot;first&quot;,&quot;first.sub-first&quot;]" alwaysOpen="true" contentItalic="true"></div></div>
</div>
<section class="demo-code" aria-label="Nested accordion usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Accordion
id="accordion-example-3"
items='[
&#123;
"value": "first",
"label": "Accordion #1",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.",
"children": [
&#123;
"value": "sub-first",
"label": "Sub accordion #1",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "sub-second",
"label": "Sub accordion #2",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "sub-third",
"label": "Sub accordion #3",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;
]
&#125;,
&#123;
"value": "second",
"label": "Accordion #2",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "third",
"label": "Accordion #3",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;
]'
defaultOpen='[
"first",
"first.sub-first"
]'
alwaysOpen="true"
contentItalic="true"
/&gt;</code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Indicators</span><h2>Without an indicator</h2><p>Use a minimal text-only accordion when visual indicators are unnecessary.</p></div>
<span class="demo-case-number">04</span>
</header>
<div class="demo-workbench">
<div id="accordion-demo-4" class="demo-canvas demo-canvas--4">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Accordion" size="default" color="primary" id="accordion-example-4" items="[{&quot;value&quot;:&quot;first&quot;,&quot;label&quot;:&quot;Accordion #1&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;},{&quot;value&quot;:&quot;second&quot;,&quot;label&quot;:&quot;Accordion #2&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;},{&quot;value&quot;:&quot;third&quot;,&quot;label&quot;:&quot;Accordion #3&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;}]" defaultOpen="[&quot;first&quot;]" showIndicator="false" contentItalic="true"></div></div>
</div>
<section class="demo-code" aria-label="Without an indicator usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Accordion
id="accordion-example-4"
items='[
&#123;
"value": "first",
"label": "Accordion #1",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "second",
"label": "Accordion #2",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "third",
"label": "Accordion #3",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;
]'
defaultOpen='[
"first"
]'
showIndicator="false"
contentItalic="true"
/&gt;</code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Indicators</span><h2>Chevron indicator</h2><p>Communicate expanded state with a rotating chevron.</p></div>
<span class="demo-case-number">05</span>
</header>
<div class="demo-workbench">
<div id="accordion-demo-5" class="demo-canvas demo-canvas--5">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Accordion" size="default" color="primary" variant="chevron" id="accordion-example-5" items="[{&quot;value&quot;:&quot;first&quot;,&quot;label&quot;:&quot;Accordion #1&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;},{&quot;value&quot;:&quot;second&quot;,&quot;label&quot;:&quot;Accordion #2&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;},{&quot;value&quot;:&quot;third&quot;,&quot;label&quot;:&quot;Accordion #3&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;}]" defaultOpen="[&quot;first&quot;]" indicator="chevron" indicatorPosition="start" contentItalic="true"></div></div>
</div>
<section class="demo-code" aria-label="Chevron indicator usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Accordion
variant="chevron"
id="accordion-example-5"
items='[
&#123;
"value": "first",
"label": "Accordion #1",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "second",
"label": "Accordion #2",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "third",
"label": "Accordion #3",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;
]'
defaultOpen='[
"first"
]'
indicator="chevron"
contentItalic="true"
/&gt;</code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Layout</span><h2>Separated title and indicator</h2><p>Place the title and state indicator at opposite ends of each trigger.</p></div>
<span class="demo-case-number">06</span>
</header>
<div class="demo-workbench">
<div id="accordion-demo-6" class="demo-canvas demo-canvas--6">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Accordion" size="default" color="primary" variant="chevron" id="accordion-example-6" items="[{&quot;value&quot;:&quot;first&quot;,&quot;label&quot;:&quot;Accordion #1&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;},{&quot;value&quot;:&quot;second&quot;,&quot;label&quot;:&quot;Accordion #2&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;},{&quot;value&quot;:&quot;third&quot;,&quot;label&quot;:&quot;Accordion #3&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;}]" defaultOpen="[&quot;first&quot;]" indicator="chevron" indicatorPosition="end" contentItalic="true"></div></div>
</div>
<section class="demo-code" aria-label="Separated title and indicator usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Accordion
variant="chevron"
id="accordion-example-6"
items='[
&#123;
"value": "first",
"label": "Accordion #1",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "second",
"label": "Accordion #2",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "third",
"label": "Accordion #3",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;
]'
defaultOpen='[
"first"
]'
indicator="chevron"
indicatorPosition="end"
contentItalic="true"
/&gt;</code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Surface</span><h2>Bordered accordion</h2><p>Group sections inside one bordered surface with dividing lines.</p></div>
<span class="demo-case-number">07</span>
</header>
<div class="demo-workbench">
<div id="accordion-demo-7" class="demo-canvas demo-canvas--7">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Accordion" size="default" color="primary" id="accordion-example-7" items="[{&quot;value&quot;:&quot;first&quot;,&quot;label&quot;:&quot;Accordion #1&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;},{&quot;value&quot;:&quot;second&quot;,&quot;label&quot;:&quot;Accordion #2&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;},{&quot;value&quot;:&quot;third&quot;,&quot;label&quot;:&quot;Accordion #3&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;}]" defaultOpen="[&quot;first&quot;]" bordered="true" contentItalic="true"></div></div>
</div>
<section class="demo-code" aria-label="Bordered accordion usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Accordion
id="accordion-example-7"
items='[
&#123;
"value": "first",
"label": "Accordion #1",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "second",
"label": "Accordion #2",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "third",
"label": "Accordion #3",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;
]'
defaultOpen='[
"first"
]'
bordered="true"
contentItalic="true"
/&gt;</code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Surface</span><h2>Bordered open content</h2><p>Render each section as an independent rounded card.</p></div>
<span class="demo-case-number">08</span>
</header>
<div class="demo-workbench">
<div id="accordion-demo-8" class="demo-canvas demo-canvas--8">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Accordion" size="default" color="primary" id="accordion-example-8" items="[{&quot;value&quot;:&quot;first&quot;,&quot;label&quot;:&quot;Accordion #1&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;},{&quot;value&quot;:&quot;second&quot;,&quot;label&quot;:&quot;Accordion #2&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;},{&quot;value&quot;:&quot;third&quot;,&quot;label&quot;:&quot;Accordion #3&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;}]" defaultOpen="[&quot;second&quot;]" indicatorPosition="end" separated="true" contentItalic="true"></div></div>
</div>
<section class="demo-code" aria-label="Bordered open content usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Accordion
id="accordion-example-8"
items='[
&#123;
"value": "first",
"label": "Accordion #1",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "second",
"label": "Accordion #2",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "third",
"label": "Accordion #3",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;
]'
defaultOpen='[
"second"
]'
indicatorPosition="end"
separated="true"
contentItalic="true"
/&gt;</code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">States</span><h2>Disabled section</h2><p>Disable an individual section while keeping the rest of the accordion interactive.</p></div>
<span class="demo-case-number">09</span>
</header>
<div class="demo-workbench">
<div id="accordion-demo-9" class="demo-canvas demo-canvas--9">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Accordion" size="default" color="primary" id="accordion-example-9" items="[{&quot;value&quot;:&quot;first&quot;,&quot;label&quot;:&quot;Accordion #1&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;},{&quot;value&quot;:&quot;second&quot;,&quot;label&quot;:&quot;Accordion #2&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;,&quot;disabled&quot;:true},{&quot;value&quot;:&quot;third&quot;,&quot;label&quot;:&quot;Accordion #3&quot;,&quot;content&quot;:&quot;This is the item&#39;s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.&quot;}]" defaultOpen="[&quot;first&quot;]" contentItalic="true"></div></div>
</div>
<section class="demo-code" aria-label="Disabled section usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Accordion
id="accordion-example-9"
items='[
&#123;
"value": "first",
"label": "Accordion #1",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;,
&#123;
"value": "second",
"label": "Accordion #2",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure.",
"disabled": true
&#125;,
&#123;
"value": "third",
"label": "Accordion #3",
"content": "This is the item\'s accordion body. It is hidden by default until the section is opened. Use it for supporting details, explanations, or progressive disclosure."
&#125;
]'
defaultOpen='[
"first"
]'
contentItalic="true"
/&gt;</code></pre>
</section>
</div>
</article></div></section>
<section id="events" class="detail-section"><div class="detail-section-heading"><span>Component events</span><h2>Events</h2><p>Public events declared by this component. Custom events bubble from the component root and expose state through <code>event.detail</code>.</p></div><div class="detail-events-grid"><div class="detail-events-list"><div><code>@change</code><span>Fires when the component value or selection changes.</span></div><div><code>@open</code><span>Fires when the component opens.</span></div><div><code>@close</code><span>Fires when the component closes.</span></div></div><section class="demo-code"><header><span><span class="icon-[lucide--radio] size-4" aria-hidden="true"></span>Event listener</span><small>.js</small></header><pre><code>const component = document.querySelector('[data-wrn-events]')
component.addEventListener('change', (event) =&gt; &#123;
console.log(event.detail)
&#125;)</code></pre></section></div></section>
<section id="api" class="detail-section"><div class="detail-section-heading"><span>Component API</span><h2>Props and configuration</h2><p>All content and behavior shown above is supplied through these props and slots.</p></div><div class="docs-table-wrap"><table class="docs-table"><thead><tr><th>Prop</th><th>Type</th><th>Default</th><th>Required</th></tr></thead><tbody><tr><td><code>size</code></td><td>string</td><td><code>"default"</code></td><td>No</td></tr><tr><td><code>color</code></td><td>string</td><td><code>"primary"</code></td><td>No</td></tr><tr><td><code>variant</code></td><td>string</td><td><code>"default"</code></td><td>No</td></tr><tr><td><code>class</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>id</code></td><td>string</td><td><code>"accordion"</code></td><td>No</td></tr><tr><td><code>items</code></td><td>string</td><td><code>[]</code></td><td>No</td></tr><tr><td><code>defaultOpen</code></td><td>string</td><td><code>[]</code></td><td>No</td></tr><tr><td><code>multiple</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>alwaysOpen</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>disabled</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>indicator</code></td><td>string</td><td><code>"plus"</code></td><td>No</td></tr><tr><td><code>indicatorPosition</code></td><td>string</td><td><code>"start"</code></td><td>No</td></tr><tr><td><code>showIndicator</code></td><td>boolean</td><td><code>true</code></td><td>No</td></tr><tr><td><code>bordered</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>separated</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>flush</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>contentItalic</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr></tbody></table></div></section>
</main>
<aside class="detail-aside">
<div class="detail-toc"><strong>On this page</strong><a href="#playground">Playground</a><a href="#accordion-demo-1">Default accordion</a><a href="#accordion-demo-2">Always open</a><a href="#accordion-demo-3">Nested accordion</a><a href="#accordion-demo-4">Without an indicator</a><a href="#accordion-demo-5">Chevron indicator</a><a href="#accordion-demo-6">Separated title and indicator</a><a href="#accordion-demo-7">Bordered accordion</a><a href="#accordion-demo-8">Bordered open content</a><a href="#accordion-demo-9">Disabled section</a><a href="#events">Events</a><a href="#api">Props API</a></div>
</aside>
</div>
<nav class="detail-pagination">
<span></span>
<a href="/components/alert"><small>Next</small><strong>Alert →</strong></a>
</nav>
}
}