collapsable.js
Interaction playground

CSSScript.com Demo Page

Collapsable.js JS Library Demos

Download Back To CSSScript.Com

Open, close, and explore. A collection of interactive panels, from simple reveals to nested accordions.

01 /

Make room for more

Independent panels
1 of 3 open

Open any combination. The first panel starts open.

02 /

One thing at a time

Accordion
All panels may close
03 /

Take another route

External controls + URL hash
Coast

The buttons and link control the same panels. Open a permalink to start with that destination selected.

04 /

A layer deeper

Nested panels

Inner panels keep their own state when the outer panel closes.

05 /

Two reveals. One action.

Multiple controls + content areas

Weekend field notes

THE PLAN

Leave before sunrise. Follow the old trail to the lookout and take the longer way home.

THE PACK

A light jacket, a paper map, water, and something good to share at the top.

Toggle from here, tooBoth controls stay in sync
06 /

Change the gesture

Custom event + selectors + classes

A different gesture, the same reveal. This panel has its own controls, content selectors, and state classes.

Double-click or double-tap the heading. Keyboard: focus the heading and press Enter or Space.

07 /

Adapt to the space

Media queries

On wide screens, this content stays visible. At 760px and below, the heading becomes a toggle. It starts open from 540–760px and closed below 540px.

Resize the window to switch between static content and a collapsible panel.

08 /

Behind every interaction

Actions + lifecycle events
Active
LIVE EVENT FEED
  1. Interact with the panel to see its events.

Destroy restores static content. Reinitialize brings the interaction back. Actions send a custom payload to the event feed.