Skip to main content
Version: latest
Works everywhere

Animated works in both server and client environments. Always use the standard import (e.g. @prokodo/ui/animated) — the library detects the runtime automatically.

Animated

The Animated component wraps any React child and applies a CSS entrance animation. Animation direction, delay, and duration are controlled via props and design tokens.

Live demo →

Overview

import { Animated } from "@prokodo/ui/animated"
;<Animated direction="up">
<p>This content fades in from below.</p>
</Animated>

Import

import { Animated } from "@prokodo/ui/animated"

CSS:

import "@prokodo/ui/animated.css"

Props

PropTypeDefaultRequiredDescription
childrenReactNodeContent to animate.
animation"bottom-top" | "top-bottom" | "left-right" | "right-left""bottom-top"Entrance animation direction.
speed"fast" | "slow"Animation speed preset.
disabledbooleanfalseDisable the animation entirely.
thresholdnumberIntersectionObserver visibility threshold (0–1).
intersectionObserverOptionsIntersectionObserverInitFull IntersectionObserver options override.
classNamestringCSS class on root element.
onAnimate() => voidCalled when the animation triggers.

See src/components/animated/Animated.model.ts for the full AnimatedProps type.


Design Tokens

Animated does not define or consume CSS custom properties. Animation timing and transform behaviour are controlled entirely via BEM modifier classes (--has-fast-speed, --has-slow-speed) rather than tokens.


WCAG 2.2 Status

CriterionNameStatusNote
1.1.1Non-text Content (A)🔍 Manual reviewAll images, icons, and media require a text alternative (alt, aria-label, or aria-labelledby). Decorative-only elements must carry aria-hidden.
2.2.2Pause, Stop, Hide (A)🔍 Manual reviewAnimations or auto-rotating content lasting more than 5 s must provide a pause/stop control.
2.3.1Three Flashes or Below Threshold (A)🔍 Manual reviewAnimated content must not flash more than 3 times per second.
4.1.2Name, Role, Value (A)🔍 Manual reviewName, role, and state of all interactive UI components must be programmatically determinable via native HTML semantics or ARIA.

Test coverage: 2 jest-axe assertion(s) across 5 test file(s) · 0 ARIA attribute occurrence(s) in source scan. Criteria marked 🔍 require manual verification in the final product integration and theme context.

Storybook

👉 Open Animated in Storybook


Source

src/components/animated/Animated.model.ts