Cube

A rounded box primitive with variants, sizes, and animation support.

Preview

Usage

tsx
import { Scene, Cube } from "@3d-ui/components"

export function MyCube() {
  return (
    <Scene>
      <Cube 
        variant="primary" 
        size="lg" 
        animate 
        rotationSpeed={0.01}
        metalness={0.2}
        roughness={0.4}
      />
    </Scene>
  )
}

Variants

From left to right: default, primary, secondary, destructive

Props

PropTypeDefault
variant"default" | "primary" | "secondary" | "destructive" | "outline" | "ghost""default"
size"sm" | "default" | "lg""default"
animatebooleanfalse
rotationSpeednumber0.01
wireframebooleanfalse
metalnessnumber0.1
roughnessnumber0.5