Animation
Tokenami allows you to define reusable animation keyframes in your configuration and reference them through theme tokens.Basic Configuration
Define keyframes and reference them in your theme:Using Animations
Apply animations using the animation property:Official System Animations
The @tokenami/ds package includes several useful animations:Spin
Continuous rotation (useful for loading spinners):Ping
Pulse and scale effect:Pulse
Opacity fade in and out:Bounce
Bouncing effect:Wiggle
Rotation wiggle:Creating Custom Animations
Slide In
Scale
Shake
Gradient Shift
Glow
Animation Tokens
Create a comprehensive set of animation tokens:Pausing Animations
Control animation playback:Animation Delays
Add delays to stagger animations:Fill Modes
Control animation state before and after:none, forwards, backwards, both
Multiple Animations
Apply multiple animations:Responsive Animations
Different animations at different breakpoints:Conditional Animations
Animate on state changes:Performance Considerations
Use transform and opacity
Use transform and opacity
These properties are GPU-accelerated and provide the smoothest animations. Avoid animating properties like
width, height, or top when possible.Add will-change sparingly
Add will-change sparingly
Use
will-change to hint browser optimization, but remove it after animation completes:Respect prefers-reduced-motion
Respect prefers-reduced-motion
Disable animations for users who prefer reduced motion:
Easing Functions
Define custom easing curves:Loading Spinner Example
Notification Example
Next Steps
Official System
Explore the @tokenami/ds package
Building Your Own
Create a custom design system