# unicornstudio-react [![npm version](https://badge.fury.io/js/unicornstudio-react.svg)](https://badge.fury.io/js/unicornstudio-react) [![npm downloads](https://img.shields.io/npm/dm/unicornstudio-react.svg)](https://www.npmjs.com/package/unicornstudio-react) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/) [![React](https://img.shields.io/badge/React-18%2B-blue.svg)](https://reactjs.org/) [![Next.js](https://img.shields.io/badge/Next.js-13%2B-black.svg)](https://nextjs.org/) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=diegopeixoto_unicornstudio-react&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=diegopeixoto_unicornstudio-react) [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](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 `