Search documentation

Search the documentation and open a page.

An interactive component that expands and collapses a panel.

Loading...

Installation

pnpm dlx shadcn@latest add @wirekyt/collapsible

Composition

<app-collapsible> ├── <button app-collapsible-trigger> │ └── [app-collapsible-indicator] (optional) └── <div *app-collapsible-content>

Examples

Default

Loading...

Flight Details

Loading...

Order Summary

Loading...

Settings Panel

Loading...

API Reference

<app-collapsible>

Inputs

InputTypeDefaultDescription
idstring | undefinedgeneratedUnique identifier used to create the collapsible part IDs.
idsPartial<CollapsibleElementIds> | undefined—Overrides the generated IDs for individual parts.
openboolean | undefined—Open state when controlled.
defaultOpenbooleanfalseInitial open state when uncontrolled.
disabledbooleanfalseDisables interaction with the collapsible.
collapsedHeightnumber | string | undefined—Height retained while the content is collapsed.
collapsedWidthnumber | string | undefined—Width retained while the content is collapsed.
lazyMountbooleanfalseMounts the content only after it is first opened.
unmountOnExitbooleanfalseRemoves the content from the DOM after its exit animation finishes.

Outputs

OutputTypeDescription
openChangeCollapsibleOpenChangeDetailsEmits details whenever the open state changes.
exitCompletevoidEmits after the closing animation has completed.

Provider and Utilities

ExportAngular API
CollapsibleRootProviderDirective that provides an externally created collapsible API through value.
useCollapsible(options)Creates the signal-backed collapsible machine inside an Angular injection context.
injectCollapsibleContext()Injects the nearest collapsible context.
CollapsibleImportsReadonly collection containing the collapsible UI directives and provider.

Types

ExportDescription
CollapsibleApiConnected collapsible state and actions.
CollapsibleElementIdsOverrides for generated collapsible part IDs.
CollapsibleMachinePropsConfiguration accepted by the collapsible machine.
CollapsibleOpenChangeDetailsDetails emitted by openChange.
CollapsibleServiceCollapsible state-machine service.
UseCollapsibleOptionsOptions accepted by useCollapsible.
UseCollapsiblePropsProperties used to create the collapsible machine.
UseCollapsibleReturnSignal-backed value returned by useCollapsible.