Valyro Русская версия

Gradient Mixer

Drag colour points over a canvas and copy the layered CSS gradient. Free, MIT · Interactive blocks › Small editors and calculators

Editor of a layered background: colour points on a canvas, each a radial CSS layer with its own colour, opacity and two radii. Drag the points or move them with the arrow keys, set exact values in the panel, undo and redo whole actions, and copy CSS built by the same serializer as the preview.

Installation

npx valyro-cli@latest add gradient-mixer
npx shadcn@latest add https://valyro.xyz/r/gradient-mixer.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { GradientMixer } from 'valyro-ui';

Props

PropTypeDefault
valueGradientValueThe composition: a base colour and radial layers, the first one on top.
defaultValueGradientValueDEFAULT_GRADIENTInitial composition when uncontrolled. Default: three colour points on a dark base.
onValueChange(value: GradientValue) => voidCalled with the whole new composition after each change (a drag reports once, when it ends).
maxPointsnumber8Most layers. Default 8.
historyLimitnumber50Most undoable actions. Default 50.
showControlsbooleantruePanel with the layer list and exact fields. Default true.
showExportbooleantrueThe CSS code and its copy button. Default true.
onExport(css: string) => voidCalled with the CSS when it is copied.
aspectRationumber | string'16 / 9'Proportions of the canvas. Default 16 / 9.
colorPickerLabelsPartial<ColorPickerPopoverLabels>Texts of the colour pickers inside the editor.
labelsPartial<GradientMixerLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

  • Pixel Painter — Draw on a pixel grid and save a PNG
  • Crafting Recipe — Recipe card: batches, ingredients needed and what is missing
  • Feature Hotspots — Numbered points on an image that open a note about each detail
  • Exploded Layers — Prepared image layers pulled apart with captions
  • Prediction Card — The reader guesses first, then sees the answer and the explanation
  • Detail Dial — Choose how deep an explanation goes: short, detailed or full
  • Version Scrubber — Step through prepared versions of a design with one slider
  • Page Minimap — Schematic map of a long page with the visible area
  • Peel Sticker — A sticker you peel back by its corner to reveal what is under it
  • Scratch Reveal — Scratch off a cover to reveal text or a picture
  • Tear-off Ticket — A ticket whose stub tears off along the perforation
  • Split-Flap Board — Mechanical departure board: only the changed characters flip

Previous: Priority Budget · Next: Pixel Painter · All Interactive blocks