Skip to content
Cojeev UI

Shape scene

3D

A tactile 3D composition made from Cojeev shapes, with a static fallback and motion preferences built in.

React · copy into your project · light and dark themes

Try it

Loading preview…

Take it with you

Copy the example, API and usage notes for your editor or AI assistant.

Add to your project

Terminal
npx shadcn@latest add https://luv-jeri.github.io/cojeev-ui/r/shape-scene.json

The command includes the component’s shared dependencies. Your project keeps editable source files.

Include the complete example

This example also composes button. Install its parts together:

Terminal
npx shadcn@latest add https://luv-jeri.github.io/cojeev-ui/r/shape-scene.json https://luv-jeri.github.io/cojeev-ui/r/button.json

Using shape scene

  • Place the sculpture beside generous typography. Its reserved aspect ratio keeps the surrounding layout stable while it loads.

  • Choose from sixteen authored shapes and clay, glazed, grain or ripple shader materials. The default palette follows AppearanceProvider; explicit warm/cool palettes are also available.

  • This optional entry installs Three.js; the rest of the library does not require it. Initialization waits until the scene enters the viewport.

  • Procedural object-space grain and flowing contour shaders use the existing lighting pass. Offscreen and hidden scenes pause; palette changes recolour meshes without rebuilding the context.

API

Compose the exported parts below. The prop types are read from the React source during the registry build.

Native element or underlying primitive props are inherited where declared, including accessible labels, event handlers and refs.

ShapeSceneProps

PropTypeRequired
palette"cojeev" | "warm" | "cool"No
shapesreadonly SceneShape[]No
density"sparse" | "balanced" | "full"No
interactivebooleanNo
animatebooleanNo
material

Tactile procedural surfaces, including an animated ripple shader.

SculptureMaterialNo

Accessibility

  • Provide a useful aria-label when the artwork conveys meaning, or aria-hidden for a decorative composition.

  • Global Off and reduced motion stop ambient and pointer motion. Offscreen and hidden scenes pause work.

  • Without WebGL2 the authored static shapes remain visible, with a clear fallback description.

States and appearance

loadinganimatedstillfallback

For conditional content, keep a MotionPresence boundary around keyed MotionSurface children. The shared entrance and exit states work with native primitives and respect your motion preference.

Try pointer and keyboard interaction, and switch the appearance control in the navigation to compare light and dark mode. Motion respects reduced motion preferences.