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
| Prop | Type | Default |
|---|---|---|
| variant | "default" | "primary" | "secondary" | "destructive" | "outline" | "ghost" | "default" |
| size | "sm" | "default" | "lg" | "default" |
| animate | boolean | false |
| rotationSpeed | number | 0.01 |
| wireframe | boolean | false |
| metalness | number | 0.1 |
| roughness | number | 0.5 |