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

Gradient Mixer

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

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

Previous: Execution Queue · Next: Pixel Painter · All Image generation