Transition
stableManages entering/entered/exiting/exited states for CSS transitions.
Basic usage
fade
Examples
Slide animations
slide-up, slide-down, slide-left, slide-right — content enters from the opposite edge.
Scale animations
zoom scales from 75%, grow scales from 90% — both combine with fade.
zoom
grow
Collapse and fade
collapse slides from the top edge; fade is pure opacity-only.
fade
Render function (status)
Pass a function as children to receive the current transition status and drive custom styles.
state: entered
animation prop
Pick from 8 built-in animations: fade, slide-up/down/left/right, zoom, grow, collapse.
Features
- Eight animation types.
- Four-stage state machine.
- unmountOnExit support.
- Timeout control.
Installation
bash
pnpm dlx structyl add transitionAPI Reference
Transition
Data-state transition wrapper.
| Prop | Type | Default |
|---|---|---|
| in | booleanOpen state. | false |
| appear | booleanMarks initial appearance. | — |
| mountOnEnter | unmountOnExit | booleanMount behavior. | false |
| timeout | number | { appear?: number; enter?: number; exit?: number }Transition duration metadata. | — |
| className | stringAdditional Tailwind classes merged with the component defaults. | — |