Motion System
VDL Motion System
The VDL motion system (packages/design-tokens/src/motion.css) provides centralized keyframes, easing functions, and animation utilities for the entire ecosystem.
Principles
- Motion communicates state, not decoration -- every animation serves a purpose
- Spring physics for interactive elements -- natural, responsive feedback
- Staggered reveals for lists and grids -- progressive disclosure of content
- Respect reduced motion -- all animations honor
prefers-reduced-motion
Easing Functions
Standard Curves
| Token | CSS Value | Use Case |
|---|---|---|
--vdl-ease-smooth | cubic-bezier(0.4, 0, 0.2, 1) | General transitions |
--vdl-ease-snappy | cubic-bezier(0.25, 0.46, 0.45, 0.94) | Quick interactions |
--vdl-ease-bounce | cubic-bezier(0.68, -0.55, 0.265, 1.55) | Playful emphasis |
Spring Physics (v5.0)
Spring curves simulate physical spring behavior with overshoot, creating natural-feeling interactive feedback.
| Token | CSS Value | Character |
|---|---|---|
--vdl-ease-spring-gentle | cubic-bezier(0.34, 1.56, 0.64, 1) | Subtle overshoot |
--vdl-ease-spring-medium | cubic-bezier(0.175, 0.885, 0.32, 1.275) | Standard spring |
--vdl-ease-spring-snappy | cubic-bezier(0.22, 1.20, 0.36, 1) | Quick spring |
Directional Curves (v5.0)
| Token | CSS Value | Use Case |
|---|---|---|
--vdl-ease-decelerate | cubic-bezier(0, 0, 0.2, 1) | Enter transitions (elements arriving) |
--vdl-ease-accelerate | cubic-bezier(0.4, 0, 1, 1) | Exit transitions (elements leaving) |
Duration Scale
| Token | Value | Use Case |
|---|---|---|
--vdl-duration-fast | 100ms | Micro-interactions (hover, focus) |
--vdl-duration-normal | 200ms | Standard transitions |
--vdl-duration-slow | 300ms | Complex transitions |
--vdl-duration-entrance | 400ms | Page/section entrance |
Entrance Animations
Core Entrances
| Class | Keyframe | Duration | Easing | Use Case |
|---|---|---|---|---|
.vdl-animate-fade-in | vdl-fade-in | 400ms | smooth | General appearance |
.vdl-animate-fade-in-up | vdl-fade-in-up | 400ms | smooth | Cards, sections |
.vdl-animate-fade-in-down | vdl-fade-in-down | 300ms | smooth | Dropdowns, tooltips |
.vdl-animate-slide-in-right | vdl-slide-in-right | 300ms | snappy | Toasts, side panels |
.vdl-animate-slide-in-left | vdl-slide-in-left | 300ms | snappy | Back navigation |
.vdl-animate-scale-in | vdl-scale-in | 200ms | smooth | Modals, popovers |
Usage
<!-- Card entrance -->
<div class="vdl-animate-fade-in-up">
<h2>Vault Performance</h2>
</div>
<!-- Modal -->
<dialog class="vdl-animate-scale-in">
<p>Confirm transaction</p>
</dialog>Transaction Animations (v5.0)
DeFi-specific animations for transaction states and interactions.
Pending State
<!-- Breathing dot for pending transactions -->
<span class="vdl-animate-pulse-breathe">
<span class="w-2 h-2 rounded-full bg-amber-9"></span>
</span>vdl-pulse-breathe: Gentle scale + opacity oscillation (2s cycle). Communicates "in progress" without urgency.
Compound Ring
<!-- Expanding ring for vault compound events -->
<div class="vdl-animate-ring-expand">
<CompoundIcon />
</div>vdl-ring-expand: Expanding ring that fades out (1.5s cycle). Represents value being compounded into the vault.
Spring Pop
<!-- Button feedback -->
<button class="vdl-animate-spring-pop">
Stake
</button>vdl-spring-pop: Quick scale 0.9 → 1.05 → 1.0 with spring easing. Satisfying click feedback for primary actions.
Slide Up Spring
<!-- Bottom sheet / toast -->
<div class="vdl-animate-slide-up-spring">
Transaction confirmed
</div>vdl-slide-up-spring: Slides up from bottom with slight overshoot (500ms). For toasts, bottom sheets, success confirmations.
Staggered Reveals (v5.0)
Progressive disclosure for lists and grids. Children animate in sequence with a configurable delay.
Usage
<ul class="vdl-stagger-children">
<li>First (0ms delay)</li>
<li>Second (50ms delay)</li>
<li>Third (100ms delay)</li>
<!-- ... up to 8+ items -->
</ul>Configuration
| Token | Default | Purpose |
|---|---|---|
--vdl-stagger-delay | 50ms | Delay between each child |
Children 1-8 get incremental delays. Children 9+ share the same maximum delay to prevent excessive wait times.
Custom Delay
.fast-stagger {
--vdl-stagger-delay: 30ms;
}
.dramatic-stagger {
--vdl-stagger-delay: 80ms;
}Continuous Animations
| Class | Keyframe | Duration | Use Case |
|---|---|---|---|
.vdl-animate-shimmer | vdl-shimmer | 2s linear | Skeleton loaders |
.vdl-animate-glow-pulse | vdl-glow-pulse | 2s ease | Active elements (compound, bridge) |
.vdl-animate-float | vdl-float | 6s ease | Hero decorative elements |
.vdl-animate-spin-slow | vdl-spin-slow | 3s linear | Loading spinners |
Data Display
Tabular Numbers
<span class="vdl-data-num">1,234,567.89</span>The .vdl-data-num class applies tabular-nums lining-nums and Inter's data-specific OpenType features. Use for all financial values to ensure columns align.
Accessibility
Reduced Motion
All VDL animations respect prefers-reduced-motion: reduce:
@media (prefers-reduced-motion: reduce) {
.vdl-animate-* {
animation: none;
}
.vdl-stagger-children > * {
animation: none;
opacity: 1;
transform: none;
}
}When reduced motion is active:
- All animations are disabled
- Staggered children appear immediately at full opacity
- Elements snap to their final position
- Content remains fully accessible
Implementation Checklist
- Always use VDL animation classes (not custom
@keyframes) - Test with
prefers-reduced-motion: reduceenabled - Ensure no information is lost when animations are disabled
- Avoid animations that could trigger vestibular disorders (large parallax, rapid flashing)
Tailwind Animation Tokens
These are exposed in tailwind-v4.css as --animate-* values:
@theme {
--animate-fade-in: vdl-fade-in 400ms var(--vdl-ease-smooth);
--animate-spring-pop: vdl-spring-pop 300ms var(--vdl-ease-spring-medium);
--animate-shimmer: vdl-shimmer 2s linear infinite;
/* ... */
}Usage: class="animate-fade-in", class="animate-spring-pop".