Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Display

Collapsible <pm-collapsible>

Collapsible: content that opens and closes under a heading, or a long text cut short with "Show more".

Full screen

Orders ship within two working days from our warehouse in Rotterdam. You get a tracking link by email as soon as the parcel leaves. Delivery inside the EU takes two to four days, and five to nine days elsewhere. Returns are free for 30 days: print the label from your account and hand the parcel to any pickup point. Refunds reach your card within five working days after we receive the parcel.

Filters2
In stockUnder € 50

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/badge'; import '@prismora/elements/collapsible'; import '@prismora/elements/icon'; import '@prismora/elements/switch'; import '@prismora/elements/tag'; import { registerIcons } from '@prismora/elements/icon'; import { filter } from '@prismora/icons'; registerIcons([filter]); </script> <pm-collapsible heading="Advanced options" style="inline-size: min(100%, 28rem)"> <div class="pm-stack"> <pm-switch label="Use a proxy"></pm-switch> <pm-switch label="Send usage data" checked></pm-switch> </div> </pm-collapsible> <pm-collapsible preview-size="4.5rem" style="inline-size: min(100%, 28rem)"> <p>Orders ship within two working days from our warehouse in Rotterdam. You get a tracking link by email as soon as the parcel leaves. Delivery inside the EU takes two to four days, and five to nine days elsewhere. Returns are free for 30 days: print the label from your account and hand the parcel to any pickup point. Refunds reach your card within five working days after we receive the parcel.</p> </pm-collapsible> <pm-collapsible open style="inline-size: min(100%, 28rem)"> <span slot="trigger" class="pm-cluster"> <pm-icon name="filter"></pm-icon> Filters <pm-badge>2</pm-badge> </span> <div class="pm-cluster"> <pm-tag removable>In stock</pm-tag> <pm-tag removable>Under € 50</pm-tag> </div> </pm-collapsible>

States

Each state is one attribute.

Disabled

Overview

With heading (or the trigger slot) it is one disclosure: a button that shows and hides the content. With preview-size the start of the content stays visible, fades out at that height, and a "Show more" button under it opens the rest; when the content is shorter than that, there is no button. For a group where one section closes the others, use <pm-accordion>.

Attributes

AttributeTypeDefaultDescription
openbooleanfalseOpen. Setting it opens or closes it (without pm-toggle).
headingstring—Text of the button.
disabledbooleanfalseThe button does nothing.
preview-size
prop: previewSize
string—Height of the part that stays visible while closed, e.g. 6rem. Turns on the "Show more" layout.
more-label
prop: moreLabel
string—Button text while closed, with preview-size (default "Show more").
less-label
prop: lessLabel
string—Button text while open, with preview-size (default "Show less").

Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.

Events

EventReact / Svelte propDescription
pm-toggleonPmToggleBefore it opens or closes (cancelable). detail.open is the new state.
pm-openonPmOpenOpened.
pm-closeonPmCloseClosed.

Slots

SlotDescription
(default)The content.
triggerWhat the button shows, instead of heading.

CSS parts

PartDescription
::part(trigger)The button.
::part(content)The part that opens.

Methods

show(), hide(), toggle()