Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
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
| Input | Type | Default | Description |
|---|---|---|---|
id | string | undefined | generated | Unique identifier used to create the collapsible part IDs. |
ids | Partial<CollapsibleElementIds> | undefined | — | Overrides the generated IDs for individual parts. |
open | boolean | undefined | — | Open state when controlled. |
defaultOpen | boolean | false | Initial open state when uncontrolled. |
disabled | boolean | false | Disables interaction with the collapsible. |
collapsedHeight | number | string | undefined | — | Height retained while the content is collapsed. |
collapsedWidth | number | string | undefined | — | Width retained while the content is collapsed. |
lazyMount | boolean | false | Mounts the content only after it is first opened. |
unmountOnExit | boolean | false | Removes the content from the DOM after its exit animation finishes. |
Outputs
| Output | Type | Description |
|---|---|---|
openChange | CollapsibleOpenChangeDetails | Emits details whenever the open state changes. |
exitComplete | void | Emits after the closing animation has completed. |
Provider and Utilities
| Export | Angular API |
|---|---|
CollapsibleRootProvider | Directive 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. |
CollapsibleImports | Readonly collection containing the collapsible UI directives and provider. |
Types
| Export | Description |
|---|---|
CollapsibleApi | Connected collapsible state and actions. |
CollapsibleElementIds | Overrides for generated collapsible part IDs. |
CollapsibleMachineProps | Configuration accepted by the collapsible machine. |
CollapsibleOpenChangeDetails | Details emitted by openChange. |
CollapsibleService | Collapsible state-machine service. |
UseCollapsibleOptions | Options accepted by useCollapsible. |
UseCollapsibleProps | Properties used to create the collapsible machine. |
UseCollapsibleReturn | Signal-backed value returned by useCollapsible. |
Angular
React
Solid
Svelte
Vue