Accordions
Progressively reveal supporting information using native disclosure semantics.
Live preview
Can I use Xshna UI without a build pipeline?
Yes. Include the CSS and JavaScript files directly from your own server. No npm or Node.js is required in production.
Can I customize the design tokens?
Override the documented
--xsh-* properties on your data-xsh-ui container.Is the library framework independent?
Yes. It enhances standards-based HTML and can be used in PHP, Laravel, WordPress, or static pages.
HTML
<div class="xsh-accordion">
<details open>
<summary>Can I use Xshna UI without a build pipeline?</summary>
<div class="xsh-accordion__content">Yes. Include the CSS and JavaScript files directly from your own server. No npm or Node.js is required in production.</div>
</details>
<details>
<summary>Can I customize the design tokens?</summary>
<div class="xsh-accordion__content">Override the documented <code>--xsh-*</code> properties on your <code>data-xsh-ui</code> container.</div>
</details>
<details>
<summary>Is the library framework independent?</summary>
<div class="xsh-accordion__content">Yes. It enhances standards-based HTML and can be used in PHP, Laravel, WordPress, or static pages.</div>
</details>
</div>Installation & markup
Include the local stylesheet and script once on the page, then place the component inside a data-xsh-ui root. The example above works without a build system.
<link rel="stylesheet" href="/dist/xshna-ui.css">
<div data-xsh-ui>
<!-- Add the HTML example above -->
</div>
<script defer src="/dist/xshna-ui.js"></script>Component API
Public classes, attributes and hooks used by this example. Keep the xsh- prefix intact.
| Identifier | Contract |
|---|---|
xsh-accordion | Used by the example markup and component styles or behavior. |
xsh-accordion__content | Used by the example markup and component styles or behavior. |
details | Used by the example markup and component styles or behavior. |
summary | Used by the example markup and component styles or behavior. |
Accessibility & keyboard
Native details and summary provide Enter/Space toggling and expanded state announcement.
Implementation note. Use descriptive summaries and avoid hiding primary actions inside lengthy accordions.
Interaction contract
Behavioral components use the shared delegated runtime; visual-only primitives rely on semantic HTML and CSS. Runtime controls emit bubbling xsh:* CustomEvents; bind application handlers to those events when server persistence, API data or navigation is required.