# unicornstudio-react
[](https://badge.fury.io/js/unicornstudio-react)
[](https://www.npmjs.com/package/unicornstudio-react)
[](https://opensource.org/licenses/MIT)
[](http://www.typescriptlang.org/)
[](https://reactjs.org/)
[](https://nextjs.org/)
[](https://sonarcloud.io/summary/new_code?id=diegopeixoto_unicornstudio-react)
[](https://stackblitz.com/edit/unicornstudio-react-example?file=app%2Fpage.tsx)
A React component for embedding [Unicorn.Studio](https://unicorn.studio) interactive scenes in your applications. Compatible with both React (Vite) and Next.js frameworks.
> โ ๏ธ **Important**: This package is a community-created wrapper component and is **not officially affiliated** with Unicorn.Studio. It depends on Unicorn.Studio's proprietary script and services.
## Features
- ๐ **Easy Integration** - Simple React component for Next.js projects
- ๐จ **Full TypeScript Support** - Complete type definitions included
- โก **Performance Optimized** - Lazy loading and efficient resource management
- ๐ฑ **Responsive** - Works seamlessly across devices
- ๐ฎ **Interactive** - Support for mouse/touch interactions
- ๐ง **Flexible** - Extensive customization options
- ๐งน **Clean Architecture** - Proper cleanup and memory management
- ๐ก๏ธ **Error Handling** - Comprehensive error states and fallbacks
## Installation
```bash
npm install unicornstudio-react
# or
yarn add unicornstudio-react
# or
pnpm add unicornstudio-react
```
## Usage
This package supports both React (Vite/CRA) and Next.js environments with optimized imports:
### For React (Vite, Create React App, etc.)
Use the default import for standard React applications:
```tsx
import UnicornScene from "unicornstudio-react";
export default function MyComponent() {
return (
);
}
```
### For Next.js
Use the Next.js-optimized version with enhanced performance:
```tsx
import UnicornScene from "unicornstudio-react/next";
export default function MyComponent() {
return (
);
}
```
> **Note**: The Next.js version uses Next.js `Script` and `Image` components for better performance and optimization. The React version uses standard `