pitsi/ui
HomeDocsComponentsAnimationsBlocksTemplates
1
1
Sections
  • Get Started
  • Components
  • Animations
  • MCP Server
  • Forms
  • Changelog
Get Started
  • Installation
  • CLI
  • llms.txt
Components
  • Accordion
  • Alert Dialog
  • Alert
  • Aspect Ratio
  • Avatar
  • Badge
  • Breadcrumb
  • Button Group
  • Button
  • Calendar
  • Card
  • Carousel
  • Checkbox
  • Collapsible
  • Combobox
  • Command
  • Container
  • Context Menu
  • Data Table
  • Date Picker
  • Dialog
  • Drawer
  • Dropdown Menu
  • Empty
  • Field
  • Flex
  • Form
  • Grid
  • Hover Card
  • Input Group
  • Input OTP
  • Input
  • Item
  • Kbd
  • Label
  • Menubar
  • Native Select
  • Navigation Menu
  • Pagination
  • Popover
  • Progress
  • Radio Group
  • Resizable
  • Responsive
  • Scroll Area
  • Segmented Control
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Sonner
  • Spacer
  • Spinner
  • Squircle
  • Switch
  • Table
  • Tabs
  • Textarea
  • Theme Toggle
  • Toggle Group
  • Toggle
  • Tooltip
  • Typography
  • Unicorn Wrapper
Animations
  • Background Image Parallax
  • Blend Mode Cursor
  • Card Swipe Carousel
  • Cards Parallax
  • Cursor Hover Mask
  • Floating Image Gallery
  • Mouse Hover Gallery
  • Nav Menu
  • Parallax Scroll
  • Perspective Carousel
  • Perspective Section Transition
  • Scroll Expand
  • Scroll Fade
  • Scroll Scale
  • Slide Down
  • Slide Up
  • Smooth Parallax Scroll
  • Smooth Scroll
  • Sticky Footer
  • Text Along Path
  • Text Gradient Opacity
  • Text Parallax
  • Transforms 3d
  • Zoom Parallax
General

Resources, guides, and helpful links.

Documentation
Introduction
Installation
CLI
llms.txt
Next.js
Vite
Laravel
React Router
Pages
Home
Docs
Components
Animations
Blocks
Templates
Templates
Application Shell
Calendar
Dashboard
Forms
Modalbox
Profile Headers
Section Headers
Table Header
Connect
GitHub
Twitter
Get Started
Changelog
Legal
Privacy
Terms
Blocks

Larger composed sections for building pages.

Application Shell
Calendar
Dashboard
Forms
Modalbox
Profile Headers
Section Headers
Table Header
Category Filter
Comment List
Incentives
Order Confirmation
Order History
Order Summaries
Order Tracking
Product List
Product Overview
Product Review
Refund Form
Refund Overview
Refund Status
Shopping Cart
404 Page
About Us Page
Blog Details
Career Pages
Coming Soon Page
Contactus Page
Legal Pages
Login Page
Maintenance Page
Otp
Pricing Page
About Us Section
Blogs News
Clients
Contact Form
Cta
Faq
Features
Footer
Gallery
Hero Section
How It Works
Integration
Portfolio
Pricing Plans
Stats
Team
Testimonial
Components

Copy and paste UI components into your apps.

Accordion
Alert Dialog
Alert
Aspect Ratio
Avatar
Badge
Breadcrumb
Button Group
Button
Calendar
Card
Carousel
Checkbox
Collapsible
Combobox
Command
Container
Context Menu
Data Table
Date Picker
Dialog
Drawer
Dropdown Menu
Empty
Field
Flex
Form
Grid
Hover Card
Input Group
Input OTP
Input
Item
Kbd
Label
Menubar
Native Select
Navigation Menu
Pagination
Popover
Progress
Radio Group
Resizable
Responsive
Scroll Area
Segmented Control
Select
Separator
Sheet
Sidebar
Skeleton
Slider
Sonner
Spacer
Spinner
Squircle
Switch
Table
Tabs
Textarea
Theme Toggle
Toggle Group
Toggle
Tooltip
Typography
Unicorn Wrapper
Animations

Beautiful animations and effects for your UI.

Background Image Parallax
Blend Mode Cursor
Card Swipe Carousel
Cards Parallax
Cursor Hover Mask
Floating Image Gallery
Mouse Hover Gallery
Nav Menu
Parallax Scroll
Perspective Carousel
Perspective Section Transition
Scroll Expand
Scroll Fade
Scroll Scale
Slide Down
Slide Up
Smooth Parallax Scroll
Smooth Scroll
Sticky Footer
Text Along Path
Text Gradient Opacity
Text Parallax
Transforms 3d
Zoom Parallax
Sign In

Unicorn Wrapper

PreviousNext

A wrapper component for Unicorn Studio projects with optimized performance and error handling.

Powered by
shadcn/ui
Docs API Reference

Installation

pnpm dlx pitsi@latest add unicorn-wrapper
TypographyAnimations

On This Page

InstallationUsageAbout Unicorn StudioFeaturesExamplesBasic ProjectResponsive ProjectProject with Custom StylingPropsHow It WorksGetting Your Project IDNotes

Usage

import { UnicornWrapper } from "@/components/ui/unicorn-wrapper"
<UnicornWrapper className="h-[400px] w-full" projectId="your-project-id" />

About Unicorn Studio

Unicorn Studio is a tool for creating interactive 3D and motion graphics that can be embedded in React applications. The UnicornWrapper component provides an optimized way to integrate Unicorn Studio projects into your pitsi/ui applications.

Features

  • Performance Optimized: Uses Intersection Observer to only render projects when visible in viewport
  • Error Handling: Gracefully handles errors and prevents crashes
  • Lazy Loading: Projects load only when they enter the viewport (with 50px margin)
  • Production Ready: Automatically enables production mode for better performance
  • Automatic Cleanup: Properly cleans up observers on unmount
  • Ref Support: Fully supports React refs for advanced use cases

Examples

Basic Project

<UnicornWrapper projectId="abc123xyz" className="h-[500px] w-full" />

Responsive Project

<div className="container mx-auto">
  <UnicornWrapper projectId="def456uvw" className="aspect-video w-full" />
</div>

Project with Custom Styling

<UnicornWrapper
  projectId="ghi789rst"
  className="h-96 rounded-lg border shadow-lg"
/>

Props

The component accepts all props from UnicornSceneProps from the unicornstudio-react package, plus:

PropTypeDefaultDescription
projectIdstring-The unique project ID from Unicorn Studio
classNamestring-Additional CSS classes to apply to the wrapper
productionbooleantrueWhether to enable production mode (optimized rendering)
onError() => void-Callback when an error occurs (automatically handled)

For the complete list of available props, see the Unicorn Studio React documentation.

How It Works

The wrapper enhances the base UnicornScene component with:

  1. Intersection Observer: Monitors when the component enters/exits the viewport
  2. Conditional Rendering: Only renders the project when visible (with 50px margin)
  3. Error Boundary: Catches errors and unmounts the component to prevent crashes
  4. Ref Forwarding: Supports both callback and object refs

This approach significantly improves performance when you have multiple projects on a page or projects that are initially offscreen.

Getting Your Project ID

To use this component, you'll need:

  1. Create a project at unicorn.studio
  2. Get your project ID from the Unicorn Studio dashboard
  3. Use the project ID in the component props

Notes

  • The component requires unicornstudio-react to be installed
  • Projects only load when they're within 50px of entering the viewport
  • Production mode is enabled by default for better performance
  • If a project errors, it will automatically unmount to prevent app crashes
  • The wrapper has a 10% intersection threshold for triggering visibility
"use client"

import { UnicornWrapper } from "@/components/ui/unicorn-wrapper"

export function UnicornWrapperDemo() {
  return (
    <div className="flex size-[400px] items-center justify-center overflow-hidden rounded-2xl">
      <UnicornWrapper
        className="h-full w-full"
        projectId="OpSYWgbtD97AYWlhMu2W"
        production
      />
    </div>
  )
}