Components/Surfaces/Collapsible
COMPONENT26.26

Collapsible

Expand/collapse panel on native details/summary — zero JavaScript. Same primitive as Accordion, standalone.


INSTALL

1pnpm dlx @sayagodev/mo add collapsible

Or import the files from the package (no copy):

1import "@sayagodev/mo/css/accordion.css";

Also copied as dependency: shared.css

EXAMPLES

Basic
Product details

This panel can be expanded or collapsed to reveal additional content.

Demo
@peduarte starred 3 repositories
File tree
components
ui
lib

USAGE

1<details>2  <summary>Product details</summary>3  <p>Hidden content revealed while open.</p>4</details>5 6<!-- carded per-item look -->7<details class="boxed">8  <summary>Product details</summary>9  <p>Hidden content revealed while open.</p>10</details>

API

NAMEKINDDESCRIPTION
details / summaryelementNative disclosure pair; clicking summary toggles open without JS
[open]attributeItem starts expanded; toggled by the platform
.boxedclassOptional carded per-item look (border + radius + joined stacking)
[disabled]attributeDims the item and blocks the trigger
<mo-accordion>elementAdd when several items should behave as one group (single/multiple)

FILES

src/css/accordion.cssdep: src/css/shared.css
Install:mo add collapsible

THEMING · PLAYGROUND

This is the exact component from the examples above, wearing a completely different theme. Edit the tokens and --mo-* hooks in the editor — autocomplete knows them all — and the preview obeys in real time. Your CSS always wins.

Tokens & hooks — edit live
Global tokens
--accent--accent-foreground--background--border--card--destructive--foreground--muted--muted-foreground--radius--ring
Component hooks
--mo-accordion-padding

Preview

Module: sealer head

Temperature, pressure and seal time report to the workbench in real time.

Your CSS

Try it: type --mo- for the component hooks, or edit any value — the preview obeys in real time.