valdi-animations

Implements imperative animations for Valdi component attributes and state changes.

16.4k|541|Updated Nov 6, 2025
One-click install
npx skills add https://github.com/Snapchat/Valdi --skill valdi-animations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: valdi-animations
Source: https://github.com/Snapchat/Valdi/tree/main/ai-skills/skills/valdi-animations
Command: npx skills add https://github.com/Snapchat/Valdi --skill valdi-animations

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Valdi does not support CSS transitions, keyframes, or React-style animation libraries, so developers need guidance on the framework's imperative animation model to animate layout changes, view attributes, and state transitions correctly.

Core Features & Use Cases

  • Imperative Animation API: Use this.animate() and this.animatePromise() with duration, preset curves, custom bezier control points, and spring physics to animate element attribute mutations.
  • State-Driven Animations: Use setStateAnimated() to re-render with new state while animating all resulting view mutations automatically.
  • Text Animations: Coordinate per-character or per-word text reveals using animationTransform on attributed text chunks and the <textanimationgroup> container for a shared timeline.
  • Use Case: When building an expandable card in a Valdi component, call setStateAnimated({ expanded: true }, { duration: 0.3 }) so the width and height changes animate smoothly instead of jumping instantly.

Quick Start

Ask the assistant to animate a Valdi component's width and font changes using this.animate with a 0.3 second duration and an ease-in-out curve.

Frequently Asked Questions about valdi-animations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I animate view attributes in Valdi?

Call this.animate() with options and a mutation block, then change attributes inside it via ElementRef.setAttribute(). All changes inside the block animate automatically over the specified duration and curve.

How to animate state changes in a Valdi component?

Use this.setStateAnimated(newState, options) instead of calling setState inside an animate block. It re-renders with the new state and animates all resulting view mutations with the given duration and curve.

Does Valdi support CSS transitions or keyframe animations?

No. Valdi has no transition property, @keyframes, or animation-duration. Animations are triggered programmatically through the imperative animate and animatePromise APIs inspired by iOS animateWithDuration.

How do spring animations work in Valdi?

Pass stiffness and damping in the options instead of a duration, and spring physics determine the timing. Lower damping produces more bounce, while higher damping settles smoothly.

Why is my Valdi animation running for hundreds of seconds?

The duration option is measured in seconds, not milliseconds. Passing duration: 300 means 300 seconds; use 0.3 for a 300-millisecond animation.

How do I animate per-word text reveals in Valdi?

Attach an animationTransform to an AttributedText chunk with fields like translationY, opacity, and timeOffsetBetweenParts, then wrap the labels in a textanimationgroup container so all descendants share one coordinated timeline.