Skip to content

withTransition JS

The withTransition decorator adds the declarative enter, leave and toggle behavior of the Transition primitive to an existing js-toolkit component class.

Usage

ts
import { Base } from '@studiometa/js-toolkit';
import { withTransition } from '@studiometa/ui/withTransition';

class Togglable extends withTransition(Base) {}

Use the decorator when a component already extends another base class. Extend Transition directly when transition behavior is the component's primary responsibility.

See the Transition usage guide and JS API for the shared options, methods and events.