ChatmotionChatmotion

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-merge
bun add framer-motion clsx tailwind-merge
pnpm add framer-motion clsx tailwind-merge
yarn add framer-motion clsx tailwind-merge

Framer 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

RequirementVersion
Next.js14+ (we use 16)
React18+ (we use 19)
Tailwind CSSv4
TypeScriptOptional 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 dev
npm install
npm run dev

Open http://localhost:3000 to see the playground where you can toggle options and copy the generated code.

Common Gotchas

On this page