BetaPublic beta — Read the release notes
Documentation

Collapsible

Single expandable/collapsible section.

Package
@solidiom/collapsible
Version
0.0.1-next.0
Status
stable

Preview

Single expandable/collapsible section.

Usage

Compose Root, Trigger, Content.

import * as Collapsible from "@solidiom/collapsible"

;<Collapsible.Root>Collapsible content</Collapsible.Root>

Installation

Install the package with pnpm add @solidiom/collapsible. The package requires compatible solid-js and @solidjs/web peer dependencies.

Parts

Collapsible exposes 3 parts:

  • Rootdata-part="root".
  • Triggerdata-part="trigger".
  • Contentdata-part="content".

Styling

Collapsible carries data-scope="collapsible" and data-part attributes on each part for CSS/recipe targeting. State attributes like data-state, data-disabled, and data-highlighted are exposed where applicable.

Keyboard & behavior

This primitive has no keyboard interaction. It renders content that does not independently receive focus or respond to key events.

Composition

Collapsible is designed to compose with other primitives. Its parts can be combined with Field, Button, or other primitives as needed.

SSR and hydration

Collapsible renders as semantic HTML during server rendering. Interactive behavior (keyboard handlers, state management) activates on hydration without layout shift.