Back to skills
SKILL.md
Collapse
ASecurityExpandable/collapsible content panel with animated height transition. Uses Framer Motion AnimatePresence for smooth open/close.
- 4 stars
- 0 votes
- 0 copies
- 1 view
- Added May 27, 2026
Works with
Security analysis
100/100npx -y skills add reaviz/skills --skill collapse --agent claude-codeAre you the author of Collapse?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/reaviz-collapse)# Collapse
Expandable/collapsible content panel with animated height transition. Uses Framer Motion AnimatePresence for smooth open/close.
## Import
```tsx
import { Collapse } from 'reablocks';
```
## Collapse Props
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `expanded` | `boolean` | — | Whether the content is visible |
| `animated` | `boolean` | `true` | *(deprecated)* Enable animation |
| `animation` | `MotionNodeAnimationOptions` | — | Custom animation config |
| `className` | `string` | — | Additional CSS classes |
| `theme` | `CollapseTheme` | — | Per-instance theme override |
| `children` | `ReactNode \| (() => ReactNode)` | — | Content (supports render function) |
## Basic Usage
```tsx
const [expanded, setExpanded] = useState(false);
<Button onClick={() => setExpanded(!expanded)}>Toggle</Button>
<Collapse expanded={expanded}>
<p>Collapsible content here</p>
</Collapse>
```
## With Render Function
```tsx
<Collapse expanded={expanded}>
{() => <ExpensiveComponent />}
</Collapse>
```
Content is only rendered when expanded (unmounted when collapsed via AnimatePresence).
Default animation: opacity 0→1 + height 0→auto with 0.5s ease transition.
## CollapseTheme Interface
```typescript
interface CollapseTheme {
base: string; // Container (will-change-[height,opacity], overflow-hidden)
}
```
Attribution
Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.