import { Heroes3D } from "@/components/3d/heroes";
export default function Example() {
return (
<div style={{ height: 520 }}>
<Heroes3D
variant="orb"
theme="light"
/>
</div>
);
}
Deps: three, @react-three/fiber, @react-three/drei, framer-motion
Installation
Install the runtime dependencies, then copy the component module (and the shared 3D core when the component uses WebGL).
npm install three @react-three/fiber @react-three/drei framer-motion
# Copy the component module
cp -r src/components/3d/heroes <your-project>/src/components/3d/heroes
# Copy the shared 3D core
cp -r src/components/3d/core <your-project>/src/components/3d/coreDependencies: three, @react-three/fiber, @react-three/drei, framer-motion
Usage
Every category module exposes one typed component. Pick an implementation with variant and pass props grouped by concern.
import { Heroes3D } from "@/components/3d/heroes";
export default function Example() {
return (
<div style={{ height: 520 }}>
<Heroes3D
variant="orb"
theme="light"
/>
</div>
);
}
React implementation
With every prop set explicitly. The complete, copyable source of src/components/3d/heroes/index.tsx is available in the playground’s Source tab.
import { Heroes3D } from "@/components/3d/heroes";
export default function Example() {
return (
<div style={{ height: 520 }}>
<Heroes3D
variant="orb"
theme="amoled"
title="Always on."
subtitle="An extraordinary collection of interactive 3D components for modern React developers."
cta="Explore Components"
cta2="Open Playground"
align="left"
color="#7777ff"
speed={1}
mouse
stats
quality="medium"
/>
</div>
);
}
Next.js implementation
WebGL needs the browser. Load the scene through next/dynamic with ssr disabled and a sized placeholder to avoid layout shift.
// app/animated-orb-hero/page.tsx (Next.js App Router)
"use client";
import dynamic from "next/dynamic";
// WebGL must never run on the server — load the scene client-side only.
const Heroes3D = dynamic(
() => import("@/components/3d/heroes").then((m) => m.Heroes3D),
{ ssr: false, loading: () => <div aria-busy="true" style={{ height: 520 }} /> },
);
export default function Page() {
return (
<main>
<div style={{ height: 520 }}>
<Heroes3D
variant="orb"
theme="light"
/>
</div>
</main>
);
}
TypeScript interfaces
export type Theme = "light" | "amoled";
export interface AnimatedOrbHeroProps {
/** Which 3D Hero Sections implementation to render */
variant: "orb";
theme: Theme;
/* Content */
title?: string; // default "Always on."
subtitle?: string; // default "An extraordinary collection of interactive 3D components for modern React developers."
cta?: string; // default "Explore Components"
cta2?: string; // default "Open Playground"
stats?: boolean; // default true
/* Visual */
align?: "left" | "center" | "right"; // default "left"
color?: string; // default "#7777ff"
/* Animation */
speed?: number; // 0–3, default 1
/* Interaction */
mouse?: boolean; // default true
/* Rendering */
quality?: "low" | "medium" | "high"; // default "medium"
}
Props reference
| Prop | Type | Default | Group | Description |
|---|---|---|---|---|
| variant | "orb" | — | Core | Selects the implementation. |
| theme | "light" | "amoled" | — | Core | Themes surfaces, materials and lighting. |
| title | string | "Always on." | Content | Headline |
| subtitle | string | "An extraordinary collection of interactive 3D components for modern React developers." | Content | Supporting text |
| cta | string | "Explore Components" | Content | Primary CTA |
| cta2 | string | "Open Playground" | Content | Secondary CTA |
| align | "left" | "center" | "right" | "left" | Visual | Layout |
| color | string (hex) | "#7777ff" | Visual | Accent |
| speed | number | 1 | Animation | Animation speed (0 – 3) |
| mouse | boolean | true | Interaction | Mouse interaction |
| stats | boolean | true | Content | Show stats |
| quality | "low" | "medium" | "high" | "medium" | Rendering | Quality preset |
Customization
Colour props accept any hex string. Content props accept plain strings. Every value shown in the playground maps 1:1 to a prop, so you can design visually and copy the generated code. Use Share to send a pre-configured link or Export to download the configuration JSON.
import { Heroes3D } from "@/components/3d/heroes";
export default function Example() {
return (
<div style={{ height: 520 }}>
<Heroes3D
variant="orb"
theme="light"
color="#ff5a36"
/>
</div>
);
}
Animation settings
- speedAnimation speed · 0–3
- mouseMouse interaction
All motion is suspended when prefers-reduced-motion is on.
Theme support
Pass theme="light" or theme="amoled". Lighting rigs, environment reflections, blending modes and canvas backgrounds change with it — AMOLED uses true #000000 with controlled emissive accents; Light uses soft studio lighting with contact shadows. Use the theme switch in the playground toolbar to preview both.
Responsive behavior
The component fills its parent, so size it with the container. Use the playground’s desktop / tablet / mobile selector to test. Hero layouts use container queries: below ~672px the scene becomes a full-bleed background with a scrim.
Accessibility notes
- — Hero copy is real HTML (h1, p, links) layered above the canvas.
- — The text layer is pointer-transparent so the scene stays interactive.
- — Scrims keep text legible across the whole scene.
Performance notes
- — Layouts respond to container width using container queries, not viewport media queries.
- — The canvas is lazy-loaded and suspended off-screen.
- — Pick the LOW preset for hero scenes on mobile.
Presets: LOW (DPR 1, no AA, ~35% density) · MEDIUM (DPR ≤1.5, ~70%) · HIGH (DPR ≤2, full density).