Skip to content
Back to skills

Collapse

ASecurity

Expandable/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
developmenttypescriptreactnode

Works with

  • cli

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add reaviz/skills --skill collapse --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Collapse?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Collapse
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/reaviz-collapse/badge)](https://www.skillsdirectory.com/skills/reaviz-collapse)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# 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

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.