Installation
Get up and running with Toffee Interactions in your React or Next.js project.
1Install the package
Toffee uses Emotion for CSS-in-JS. Install both:
2Add the Provider (Next.js App Router)
Wrap your root layout with ToffeeProvider. This handles Emotion SSR style injection so there is no flash of unstyled content.
3Use a component
All animated components are client-only. Import from @toffee.studio/ai-interaction-design/client.
Vite / Create React App
For non-Next.js setups, use ToffeeProvider without the useServerInsertedHTML prop — it works as a plain Emotion provider.
Two entry points:
@toffee.studio/ai-interaction-design — server-safe exports (ToffeeProvider, types, tokens)@toffee.studio/ai-interaction-design/client — client-only components and hooks