Data display

Collapsible

One native disclosure that shows and hides a panel of content, without JavaScript.

Class nameTypeDescription
collapseplf:collapseComponentA native details disclosure
collapse-triggerplf:collapse-triggerPartThe bordered summary
collapse-titleplf:collapse-titlePartThe trigger's label
collapse-iconplf:collapse-iconPartAn SVG icon before the title; an icon class there doesn't need it
collapse-contentplf:collapse-contentPartThe panel shown when open
collapse-arrowplf:collapse-arrowModifierEnds the trigger with a chevron that turns over while open

Default

Keep links and form controls out of the summary and add no roles, aria-expanded or aria-controls, which the browser already provides; for a group of disclosures, use Accordion.

More details
Content shown when the panel opens.
More details
Content shown when the panel opens.
More details
Content shown when the panel opens.

React

Collapsible from @pelatform/react renders this details with no script, and each part is a component of its own; an Icon in the trigger needs no class.

Prop Values Default
arrow true ends the trigger with a chevron that turns over while open false

The parts:

Part Element
CollapsibleTrigger A summary with collapse-trigger
CollapsibleTitle A span with collapse-title
CollapsibleContent A div with collapse-content

Other props are the element’s own, open, onToggle, className and ref included.

CSS variables

Override on a root or on a single collapsible.

Variable Default
--plf-collapsible-bg Transparent
--plf-collapsible-color Text, for the trigger, title and icons
--plf-collapsible-border Subtle border
--plf-collapsible-hover-bg Muted surface
--plf-collapsible-content-color Muted text
--plf-collapsible-radius Large radius (8px)
--plf-collapsible-gap Space 2 (8px), inside the trigger and above the content
--plf-collapsible-icon-size The control icon size (16px), for the icon and the chevron

Built with Pelatform UIv0.1.0

Components

Getting started

Foundations

Components

Actions

Data display

Navigation

Feedback

Data input

Layout

Advanced

Integrations

Blocks

Application

Authentication

Icons