Skip to main content

Starwind UI v3.0 is now available! Migration guide

Collapsible

@starwind-ui starred 3 repositories

astro

Installation

Usage

General Notes

The Collapsible component provides a way to show and hide content with a trigger button. It’s useful for FAQs, expandable sections, and progressive disclosure patterns.

The essential components are Collapsible, CollapsibleTrigger, and CollapsibleContent.

API Reference

Styled Component API

These props are added or materially changed by the installed styled component. Standard HTML attributes remain available through the inherited interfaces noted below. Expand a prop to see named type definitions and framework-specific imports. Follow the Primitive and Runtime links for lower-level behavior props.

Collapsible Trigger

Inherits button attributes.

Contains the following additional props:

Prop Type Default Toggle details
asChild boolean false
Description
Merges the component behavior and props into its child element.
Classification
Primitive override
Primitive prop
collapsible.Trigger.asChild

Primitive And Runtime API

Use these references when you need the lower-level behavior APIs behind Collapsible.

Runtime API

Collapsible primitive
createCollapsible from @starwind-ui/runtime/collapsible

Changelog

v2.0.1

  • Named the generated aggregate default export so React and Astro tooling can identify the installed component cleanly.

v2.0.0

  • Rebuilt Collapsible on Starwind Runtime for open state and panel lifecycle.
  • See the Collapsible Primitive for the underlying unstyled anatomy and behavior API.