structyl

Transition

stable

Manages 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.

slide-up
slide-down
slide-left
slide-right

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.

collapse
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.

slide-up

Features

  • Eight animation types.
  • Four-stage state machine.
  • unmountOnExit support.
  • Timeout control.

Installation

bash
pnpm dlx structyl add transition

API Reference

Transition API reference

Full props, types, defaults.

View API
Transition | structyl