Sanity plugin to preview Lottie animations
npm install sanity-plugin-lottieDeveloped and maintained by ContentWrap

---
- Easy integration: Add a Lottie animation field to your Sanity schema.
- Instant preview: See your Lottie animation right in the Studio after upload.
- File validation: Only accepts valid Lottie .json files.
- Animation info: Displays duration, frame count, and frame rate.
---
``sh`
pnpm add sanity-plugin-lottieor
yarn add sanity-plugin-lottieor
npm install sanity-plugin-lottie
---
1. Add the plugin to your Sanity config:
`ts
// sanity.config.ts
import { defineConfig } from 'sanity';
import { lottiePreview } from 'sanity-plugin-lottie';
export default defineConfig({
// ...
plugins: [lottiePreview()],
});
`
2. Use the lottie type in your schema:
`ts
// schemas/myDocument.ts
import { defineType } from 'sanity';
export default defineType({
name: 'myDocument',
title: 'My Document',
type: 'document',
fields: [
{
name: 'animation',
title: 'Lottie Animation',
type: 'lottie',
},
// ... other fields
],
});
`
---
- Upload a Lottie .json file in the Studio..json
- Instantly preview the animation, with info on duration, frames, and frame rate.
- Only valid Lottie files are accepted.
---
- Sanity Studio v3 or v4
- Lottie .json` files (exported from After Effects or similar tools)
---
MIT © ContentWrap
---
This package is developed and maintained by ContentWrap, a digital product agency specializing in Sanity and modern web development.