BetaPublic beta — Read the release notes
Documentation

Collapsible

Basic collapsible example demonstrating core behavior.

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

Examples

import * as Collapsible from "@solidiom/collapsible"

;<Collapsible.Root defaultOpen={false} onOpenChange={(open) => console.log(open)}>
  <Collapsible.Trigger>Toggle Details</Collapsible.Trigger>

  <Collapsible.Content>
    <p>This content is revealed when the collapsible is opened.</p>
    <p>It uses aria-expanded and aria-controls for accessibility.</p>
  </Collapsible.Content>
</Collapsible.Root>

The Content is only rendered when the collapsible is open. Use the disabled prop on Root to prevent toggling.