bit Bheadless

Collapsible

An interactive component which expands and collapses a panel.

Implementation: CSS Tailwind

Basic Collapsible

A BitBhCollapsibleTrigger toggles a BitBhCollapsibleContent panel. aria-expanded, aria-controls, and aria-labelledby are wired automatically.

@peduarte starred 3 repositories
@radix-ui/primitives

Default Open

Set DefaultOpen="true" to render the panel open initially (uncontrolled).

Already open
I'm open by default. Click the trigger to close me.

Render Context (rotating chevron + Close)

BitBhCollapsibleTrigger and BitBhCollapsibleContent expose a BitBhCollapsibleRenderContext via Context="c". Use it to drive UI from the open state and to call c.Close() from anywhere inside.

What's inside?

Disabled

Set Disabled="true" on the root to block interaction. The trigger receives both the native disabled attribute and a data-disabled hook.

Can't toggle me

Controlled

Drive the open state externally with Open + OnOpenChange. The button below opens or closes the collapsible programmatically.

Open: false
Internal trigger
An unhandled error has occurred. Reload 🗙