File size: 1,827 Bytes
fea495a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | import * as react_jsx_runtime from 'react/jsx-runtime';
import { U as UnicornSceneProps } from './types-Bj2y1_cd.mjs';
/**
* Next.js component for rendering Unicorn Studio WebGL animations.
*
* @remarks
* This component wraps Unicorn Studio's WebGL animation system for use in Next.js applications.
* It uses Next.js's optimized `Script` and `Image` components for better performance.
*
* The component is marked with `"use client"` as it requires browser APIs.
*
* The component requires either a `projectId` (to load from Unicorn Studio's servers)
* or a `jsonFilePath` (to load from a local JSON file).
*
* @param props - The component props
*
* @example
* Basic usage with project ID:
* ```tsx
* import { UnicornScene } from "unicornstudio-react/next";
*
* export default function Page() {
* return (
* <UnicornScene
* projectId="your-project-id"
* width={800}
* height={600}
* />
* );
* }
* ```
*
* @example
* With placeholder and callbacks:
* ```tsx
* <UnicornScene
* projectId="your-project-id"
* placeholder="/images/loading.png"
* onLoad={() => console.log("Scene loaded!")}
* onError={(err) => console.error(err)}
* />
* ```
*
* @example
* Using local JSON file with reduced quality for performance:
* ```tsx
* <UnicornScene
* jsonFilePath="/scenes/animation.json"
* scale={0.5}
* fps={30}
* lazyLoad={true}
* />
* ```
*/
declare function UnicornScene({ projectId, jsonFilePath, sdkUrl, width, height, scale, dpi, fps, altText, ariaLabel, className, lazyLoad, production, paused, placeholder, placeholderClassName, showPlaceholderOnError, showPlaceholderWhileLoading, onLoad, onError, sceneRef, }: UnicornSceneProps): react_jsx_runtime.JSX.Element;
export { UnicornScene, UnicornSceneProps, UnicornScene as default };
|