Collapsible
An interactive component which expands/collapses a content area.
Default
The standard collapsible component.
@peduarte starred 3 repositories
@spartan-ng/brain
@spartan-ng/helm
@angular/core
collapsible-example-default.ts
Animated
Use Tailwind CSS transitions to animate the expansion and collapse.
@peduarte starred 3 repositories
@spartan-ng/brain
@spartan-ng/colors
@stitches/react
collapsible-example-animated.ts
Custom Styles & Icons
Theme the collapsible using Tailwind utility classes and custom toggle icons.
Blue Theme Collapsible
Success Theme with Custom Icons
[data-state] attribute. collapsible-example-custom.ts
Installation & Usage
Installation
Imports
Basic Skeleton
API Reference
Brain API
The brain directives provide the functional logic and state management for the collapsible.
| Directive | Selector | Inputs / Outputs |
|---|---|---|
| BrnCollapsible | [brnCollapsible], brn-collapsible |
|
| BrnCollapsibleTrigger | button[brnCollapsibleTrigger] | Functional trigger for toggling the collapsible state. |
| BrnCollapsibleContent | [brnCollapsibleContent] | Container for the collapsible content. |
Helm API
The helm components provide the default spartan/ui styling.
| Component / Directive | Selector | Description |
|---|---|---|
| HlmCollapsible | hlm-collapsible, [hlmCollapsible] | Main styling container. |
| HlmCollapsibleTrigger | button[hlmCollapsibleTrigger] | Styled trigger button. |
| HlmCollapsibleContent | hlm-collapsible-content, [hlmCollapsibleContent] | Styled content area. Handles [data-state]. |