Docs

Installation

Installation

How to install dependencies and structure your app.

Add Utilities for React, Next.js, etc. projects

Install dependencies

npm i motion clsx tailwind-merge

Add util file

lib/utils.ts

import { ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
 
export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs));
}

You are good to go and start copy pasting the components into your project.

Vanilla JavaScript

Add the following script to your project head section to use Motion library.

<script src="https://cdn.jsdelivr.net/npm/motion@latest/dist/motion.js"></script>

You are good to go and start copy pasting the components into your project.