Getting Started
Set up Chatmotion in your project
Installation
Copy the files
themes.ts
utils.ts
Yes, you're copying files manually. This gives you full control to modify everything. No npm package to fight with when you want to change something.
Install dependencies
npm install framer-motion clsx tailwind-mergebun add framer-motion clsx tailwind-mergepnpm add framer-motion clsx tailwind-mergeyarn add framer-motion clsx tailwind-mergeFramer Motion does all the heavy lifting for animations. The other two are just for merging Tailwind classes cleanly.
Use it
import { ChatAnimation } from '@/components/chat-animation';
export default function Hero() {
return (
<div className="h-[600px] w-[400px]">
<ChatAnimation />
</div>
);
}The component fills its container, so give it some dimensions. If it looks tiny or huge, that's probably why.
Requirements
| Requirement | Version |
|---|---|
| Next.js | 14+ (we use 16) |
| React | 18+ (we use 19) |
| Tailwind CSS | v4 |
| TypeScript | Optional but recommended |
File Structure
ChatAnimation.tsx
SimpleChatAnimation.tsx
MessageBubble.tsx
TypingIndicator.tsx
ReactionPicker.tsx
types.ts
index.ts
Iphone15Pro.tsx
PhoneComponents.tsx
themes.ts
utils.ts
send.mp3
receive.mp3
reaction.mp3
Using the Kit
If you're using the kit as a starter instead of copying files:
bun install
bun devnpm install
npm run devOpen http://localhost:3000 to see the playground where you can toggle options and copy the generated code.