Pigment field
BackgroundsAn original GPU pigment wash using the current Cojeev palette.
Try it
Add to your project
npx shadcn@latest add https://luv-jeri.github.io/cojeev-ui/r/pigment-field.jsonThe command includes the component’s shared dependencies. Your project keeps editable source files.
Include the complete example
This example also composes contour-field, button, card, toggle-group, slider, label, typography. Install its parts together:
npx shadcn@latest add https://luv-jeri.github.io/cojeev-ui/r/pigment-field.json https://luv-jeri.github.io/cojeev-ui/r/contour-field.json https://luv-jeri.github.io/cojeev-ui/r/button.json https://luv-jeri.github.io/cojeev-ui/r/card.json https://luv-jeri.github.io/cojeev-ui/r/toggle-group.json https://luv-jeri.github.io/cojeev-ui/r/slider.json https://luv-jeri.github.io/cojeev-ui/r/label.json https://luv-jeri.github.io/cojeev-ui/r/typography.jsonUsing pigment field
Place inside a positioned parent with a height. Keep meaningful content in a sibling above the decorative field.
Control tone, speed (0–3), intensity (0–2) and paused. The canvas caps pixel density and responds to resizing.
This background is an original shader foundation; it does not yet implement pointer-fluid refraction over HTML.
Place text on an opaque native Card or other readable surface over the changing artwork; do not assume contrast against every shader pixel.
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.
PigmentFieldProps
| Prop | Type | Required |
|---|---|---|
speedRelative pace, from 0 (still) to 3. | number | No |
intensityColor and relief strength, from 0 to 2. | number | No |
toneAccent selection from the inherited Cojeev theme. | FieldTone | No |
pausedFreeze the current artwork without removing it. | boolean | No |
Accessibility
Decorative canvas is inert, hidden from assistive technology and never captures pointer events.
Reduced motion, offscreen content, document visibility and shared Motion/Flow Off suspend continuous rendering. A static fallback covers unavailable or lost contexts.
States and appearance
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.