MCPcopy Index your code
hub / github.com/diffusionstudio/lottie

github.com/diffusionstudio/lottie @v1.0.0 sqlite

repository ↗ · DeepWiki ↗ · release v1.0.0 ↗
175 symbols 406 edges 30 files 10 documented · 6%
README

Text to Lottie

Text-to-lottie is an open-source framework for generating production ready Lottie animations with claude code/codex or any other coding agent supporting skills.

Created with Text-to-Lottie

Quick Start

Install the skill:

npx skills add diffusionstudio/lottie

Then ask your coding agent to generate a Lottie animation using text-to-lottie.

Example prompt:

Create a Lottie animation from the SVG path in https://github.com/JaceThings/SF-Hello/blob/main/SVG/hello-en.svg. Reveal the path with an animation that follows the natural path direction. Apply a premium apple themed gradient to the path. Use ease-in-out timing, a transparent background, and preserve the original SVG geometry.

The agent sets up the workspace and the included player, where each animation lives as a scene inside a project. Scenes load automatically from public/projects/<project>/<scene>/lottie.json and live-update in the player as the agent edits them — so you can inspect, scrub, and refine the generated Lottie in real time.

Prompt guide

1. Ground the model

Provide SVGs, real-world data, or screenshots whenever possible. Results are significantly better when the animation is based on concrete assets.

2. Use motion design terminology

Describe timing and movement using motion design language like ease-in, ease-out, and ease-in-out.

3. Think like a camera operator

Professional motion graphics often rely on camera movement. Include camera pushes, pans, zooms, and rig-like motion in your prompt. The agent can simulate these through group transforms.

4. Request the controls you need

By default, outputs usually only expose a background color control. If you want to customize other properties, explicitly ask the agent to create controls for them.

5. Specify FPS and duration

If your animation requires a specific frame rate or length, include the desired FPS and total frame count in the prompt.

Using the Generated Animation

Generated animations can be used directly as Lottie JSON files or imported into After Effects for further refinement.

Web / vanilla HTML

<script src="https://unpkg.com/lottie-web/build/player/lottie.min.js"></script>







<script>
  lottie.loadAnimation({
    container: document.getElementById("anim"),
    renderer: "svg",
    loop: true,
    autoplay: true,
    path: "/animations/my-animation.json"
  });
</script>

React Native

import LottieView from "lottie-react-native";

export default function Loader() {
  return (
    <LottieView
      source={require("./animation.json")}
      autoPlay
      loop
      style={{ width: 200, height: 200 }}
    />
  );
}

Alternatively, React Native Skia can also render Lottie animations via its Skottie module, including on the web. It lets you customize animation properties, assets, and typographies at runtime, and since Skottie is a regular Skia drawing, it can be composed into a larger Skia scene alongside shaders, effects, and masks.

import { Skia, Canvas, Skottie, useClock } from "@shopify/react-native-skia";
import { useDerivedValue } from "react-native-reanimated";

const animation = Skia.Skottie.Make(JSON.stringify(require("./animation.json")));

export default function Loader() {
  const clock = useClock();
  const frame = useDerivedValue(
    () => ((clock.value / 1000) % animation.duration()) * animation.fps()
  );
  return (
    <Canvas style={{ width: 200, height: 200 }}>
      <Skottie animation={animation} frame={frame} />
    </Canvas>
  );
}

iOS Swift

import Lottie

let animationView = LottieAnimationView(name: "animation")
animationView.frame = view.bounds
animationView.contentMode = .scaleAspectFit
animationView.loopMode = .loop
view.addSubview(animationView)
animationView.play()

Android Kotlin

val view = findViewById<LottieAnimationView>(R.id.animationView)
view.setAnimation(R.raw.animation)
view.loop(true)
view.playAnimation()

Flutter

dependencies:
  lottie: ^latest
import 'package:lottie/lottie.dart';

Lottie.asset('assets/animation.json')

Extension points exported contracts — how you extend this code

LiveState (Interface)
* Last playback snapshot reported by the browser. Only updated on discrete * events (scene change, play, pause, scrub)
vite-plugins/scenes.ts
ControlMeta (Interface)
(no doc)
src/types/common.ts
SceneData (Interface)
(no doc)
src/lib/scene.ts
Scene (Interface)
(no doc)
src/types/common.ts
Project (Interface)
(no doc)
src/types/common.ts
ScenesTree (Interface)
(no doc)
src/types/common.ts

Core symbols most depended-on inside this repo

cn
called by 35
src/lib/utils.ts
json
called by 16
vite-plugins/scenes.ts
currentValue
called by 10
src/components/ui/numeric-slider.tsx
formatValue
called by 6
src/components/ui/numeric-slider.tsx
zoom
called by 6
src/context/canvas.tsx
useScenes
called by 6
src/context/scenes.tsx
listDirs
called by 5
vite-plugins/scenes.ts
min
called by 5
src/components/ui/numeric-slider.tsx

Shape

Function 169
Interface 6

Languages

TypeScript100%

Modules by API surface

src/context/canvas.tsx27 symbols
src/components/ui/numeric-slider.tsx21 symbols
vite-plugins/scenes.ts20 symbols
src/components/ui/dropdown-menu.tsx15 symbols
src/components/ui/context-menu.tsx15 symbols
src/components/ui/alert-dialog.tsx12 symbols
src/components/sidebar-right.tsx10 symbols
src/context/scenes.tsx8 symbols
src/components/sidebar-left.tsx6 symbols
src/router.tsx5 symbols
src/components/scenes-container.tsx5 symbols
src/types/common.ts4 symbols

Dependencies from manifests, versioned

@kobalte/core0.13.11 · 1×
@solidjs/router0.16.1 · 1×
@tailwindcss/vite4.1.13 · 1×
@types/node25.9.2 · 1×
canvaskit-wasm0.41.1 · 1×
class-variance-authority0.7.1 · 1×
clsx2.1.1 · 1×
fflate0.8.3 · 1×
lucide-solid1.18.0 · 1×
shadcn4.11.0 · 1×
solid-devtools0.34.3 · 1×

For agents

$ claude mcp add lottie \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact