Skip to main content

This package exports a single function that accepts an HTML node and returns a promise. The promise resolves when all CSS transitions on the HTML node and its children have settled.

Works with
It is unknown whether this package works with Bun
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
This package works with Browsers
JSR Score
35%
Published
3 months ago (0.3.0)

This package exports a single function that accepts an HTML node and returns a promise. The promise resolves when all CSS transitions on the HTML node and its children have settled.

await transitionsAllSettled(node)

This is useful for exit animations to wait for all CSS transitions to settle before removing the node from the DOM.

The term "settled" means that if a node received a transitionstart event, it also received a transitionend or transitioncancel event.

The package is very small. Take a look at the source to see exactly how it works.

Authored by James Kerr

Add Package

deno add @jk/transitions-all-settled

Import symbol

import * as mod from "@jk/transitions-all-settled";

Add Package

npx jsr add @jk/transitions-all-settled

Import symbol

import * as mod from "@jk/transitions-all-settled";

Add Package

yarn dlx jsr add @jk/transitions-all-settled

Import symbol

import * as mod from "@jk/transitions-all-settled";

Add Package

pnpm dlx jsr add @jk/transitions-all-settled

Import symbol

import * as mod from "@jk/transitions-all-settled";

Add Package

bunx jsr add @jk/transitions-all-settled

Import symbol

import * as mod from "@jk/transitions-all-settled";