# Lottie

> The lottie-react player, exported as-is, for the Lottie animations that ship with Crew OS (`animations/*.json`).

## Facts

- **Product**: Crew OS
- **Family**: Motion
- **Global**: `window.DigitalCrew.Lottie`
- **Source**: `digitalcrew-orchestrator: lottie-react`
- **Live preview**: /design/components/lottie/preview.html
- **Page**: /design/components/lottie

## Guidelines

**Use it for** small illustrative loops: an empty state, an onboarding step, a success tick. The files available here are ai-collaboration, check, cost-deduction, database, demolishing, dollar, filter, flash, girl-avatar, graduate, schedule, timer, trash, trend-arrow, users-team-profile, young-boy-avatar, young-boy-avatar-2 and zap (`../../assets/Animations/<name>.json`).

**What you provide**: `animationData` (the parsed JSON, required), `loop` (default true), `autoplay` (default true), `className`/`style` for size, and optionally `lottieRef`, `onComplete`, `initialSegment`. The `useLottie` hook and `LottiePlayer` type come from lottie-react.

**Anatomy**: the player renders an SVG that fills its box; size the wrapper (the preview uses 112px). The files carry their own fixed colours, drawn for light backgrounds, so on dark themes place them on a light surface (as here) or pick a file that reads on dark.

**Behaviour**: plays the file's own timeline. Neither the player nor the files check reduced motion: pass `autoplay={false}` (or `loop={false}`) when the user asks for less motion.

**Don't** use several looping animations in one view, block the page on loading a large JSON (fetch it lazily), or use Lottie where a Lucide icon would do.

## Example

```html
<div id="root" class="p-6"></div>
<script>
(function () {
  var h = React.createElement, DC = window.DigitalCrew, I = DC.Icons;
    var files = ["ai-collaboration", "schedule", "trend-arrow", "users-team-profile", "check", "zap"];
  function Tile(p) {
    var s = React.useState(null), failed = React.useState(false);
    React.useEffect(function () {
      fetch("../../assets/Animations/" + p.name + ".json").then(function (r) { if (!r.ok) throw new Error(r.status); return r.json(); })
        .then(function (d) { s[1](d); }).catch(function () { failed[1](true); });
    }, [p.name]);
    return h("figure", { className: "grid justify-items-center gap-2 rounded-xl border bg-card p-3" },
      h("div", { className: "flex h-28 w-full items-center justify-center rounded-lg bg-white" },
        s[0] ? h(DC.Lottie, { animationData: s[0], loop: true, autoplay: true, className: "size-28" })
          : h("span", { className: "text-xs text-neutral-500" }, failed[0] ? "Could not load" : "Loading…")),
      h("figcaption", { className: "text-muted-foreground font-mono text-xs" }, p.name + ".json"));
  }
  function App() {
    return h("div", { className: "grid grid-cols-3 gap-3" }, files.map(function (f) { return h(Tile, { key: f, name: f }); }));
  }
  ReactDOM.createRoot(document.getElementById("root")).render(h(DC.TooltipProvider, { delayDuration: 80 }, h(App)));
})();
</script>
```

## More in Motion

- [ActionFocusSession](/design/components/action-focus-session.md): The focus timebox for one task in the actions cockpit: a live billable clock with approve, start, pause, run and done, and a burst of sparkles on completion.
- [CardResize](/design/components/card-resize.md): A container that tweens its width and height when its content changes (`.t-resize`).
- [ChapterScrubber](/design/components/chapter-scrubber.md): A rail of ticks, one per chapter, that swell like a dock under the pointer, with a card previewing the hovered chapter.
- [ContainerScroll](/design/components/container-scroll.md): A hero block where a device-like frame starts tilted back in 3D and straightens as the page scrolls, with the title drifting up.
- [FeatureSlideshow](/design/components/feature-slideshow.md): A step-by-step feature explainer: an accordion of steps on the left that advances on a timer, a progress line on the open step, and a large media slot on the right.
- [FirstBentoAnimation](/design/components/first-bento-animation.md): A self-playing chat vignette for the bento grid: a user asks for a meeting slot, the Digital Crew avatar shows typing dots, then the reply streams in as a `Reasoning` block.
- [FourthBentoAnimation](/design/components/fourth-bento-animation.md): A scheduling vignette for the bento grid: a week ruler, three task bars that spring into place, and a time cursor that follows the pointer.
- [HyperText](/design/components/hyper-text.md): A monospaced, uppercase text effect: letters scramble through random characters, then lock in from left to right.
- [InfiniteSlider](/design/components/infinite-slider.md): A JavaScript-driven endless strip (Framer Motion) that renders its children twice and slides them in a loop, optionally slowing on hover.
- [JoyfulTaskCheckbox](/design/components/joyful-task-checkbox.md): A task checkbox with a small, restrained completion moment: one soft bloom, two sparks, then stillness.
- [Marquee](/design/components/marquee.md): An endless CSS scroll of repeated content, horizontal or vertical, speed set with two CSS variables.
- [MotionScale](/design/components/motion-scale.md): The shared motion scale made visible: the same distance travelled on each duration token and each easing, with a Replay button.
- [NumberFlowCounter](/design/components/number-flow-counter.md): A small dark pill that shows one number at a time and rolls its digits to the next value every two seconds (NumberFlow).
- [OrbitingCircles](/design/components/orbiting-circles.md): Places its children on a circular orbit around the centre of the parent and spins them, with an optional faint ring for the path.
- [ShimmerText](/design/components/shimmer-text.md): A status line with a light band sweeping across its glyphs — Max's "Thinking…" and live tool lines (`.t-shimmer`).
- [SignatureGradient](/design/components/signature-gradient.md): The signature Digital Crew gradient — indigo → pink → amber (`dc-andre`, `dc-camille`, `dc-amber`) — in its four forms.
- [SkeletonReveal](/design/components/skeleton-reveal.md): A skeleton that cross-blurs into the loaded content, so the swap reads as one motion (`.t-skel`).
- [StreamingText](/design/components/streaming-text.md): Streamed words resolving through a soft cross-blur, one after another (`.t-stream-w` → `.is-in`).
- [ThirdBentoAnimation](/design/components/third-bento-animation.md): An insight vignette for the bento grid: a smooth area line draws itself, a dot pulses at its midpoint and a dark pill above it ticks through values.
- [UniboxMotion](/design/components/unibox-motion.md): The Unibox's shared motion vocabulary: every surface moves on the same few springs, so the whole inbox feels like one physical material.
