Back to library

Color picker

Pick any color from a saturation field with hue and opacity sliders, or build a gradient with draggable stops.

Recommended API

Property or elementTypeExample initial valueDescription
fillSolid or gradientsolidChoose a solid color or linear, radial or conic gradient.
stopsColor, position and opacityTwo stopsAdd, select and remove gradient stops; adjust each stop independently.
paletteColor swatches12 colorsChoose a color from the palette.

States

StateTriggerResult
selectedChoose a swatch or color.The selected color and hex value update.
invalidEnter an invalid hex value.An error is shown and the selected color is retained.

CSS variables

VariableTypeDefaultDescription
--q-textcolor #28302aMain text and foreground color.
--q-mutedcolor #70776fColor for secondary text.
--q-font-sizelength 13pxBase size for the component text.
--q-accentcolor #344e41Accent for active controls, indicators and focus.
--q-bordercolor #dce0d8Color for outlines and dividers.
--q-surfacecolor #ffffffSurface for controls and cards.
--q-gaplength calc(var(--q-space) * 2)Space between items, based on the spacing unit.
--q-radiuslength 10pxBase corner radius.
--q-spacelength 4pxBase unit for gaps and padding.