Skip to content
Cojeev UI

Pigment field

Backgrounds

An original GPU pigment wash using the current Cojeev palette.

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/pigment-field.json

The 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:

Terminal
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.json

Using 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

PropTypeRequired
speed

Relative pace, from 0 (still) to 3.

numberNo
intensity

Color and relief strength, from 0 to 2.

numberNo
tone

Accent selection from the inherited Cojeev theme.

FieldToneNo
paused

Freeze the current artwork without removing it.

booleanNo

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

animatedpausedfallbackcontext-lostreduced-motion

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.