Theme
Sound
Jump to a component
Core · Forms
ColorPicker
ColorPicker chooses any colour: a field for saturation and brightness, a hue track and the hex. A brand kit's colours, a design's own colour.
Live, from @anicanon/sakuga 2.0.0
Sakuga for iOS and Android is coming
iOS
Web only
ColorPicker is made for the web, and isn’t part of Sakuga for iOS yet.
Android
Web only
ColorPicker is made for the web, and isn’t part of Sakuga for Android yet.
- Not for
- A colour chosen from a fixed set (skin, coat)SwatchPicker
- Adjusting colour in the editorSliderRow
Guidelines
valueandonChangespeak hex (#1f6feb). The picker keeps the hue while the colour passes through grey, black or white.presetsare the colours the design or kit already has, as swatches under the field (presetsLabel, default "Colours in use").fromPictureare the colours read from an uploaded picture, such as a logo, as a second row (pictureLabel, default "From the picture").- Typing a full hex (3 or 6 digits, with or without
#) moves the field and track to it. - For a compact form, open it in a
Popoverfrom a swatch or a field.
import { useState } from 'react';
import { ColorPicker } from '@anicanon/sakuga/ui';
export default function ColorPickerExample() {
const [value, setValue] = useState('#c2335f');
const v = value;
const set = setValue;
return (
<ColorPicker
label="Brand colour"
value={v}
onChange={set}
presets={[
{ label: 'Ink', color: '#0b0a10' },
{ label: 'Camellia', color: '#c2335f' },
{ label: 'Paper', color: '#f6f1e7' },
{ label: 'Sky', color: '#3b82c4' },
]}
fromPicture={[
{ label: 'Logo red', color: '#d6402b' },
{ label: 'Logo gold', color: '#e8b03a' },
{ label: 'Logo navy', color: '#1d2b4f' },
]}
/>
);
}PropsColorPickerProps
labelrequiredstringvaluestringHex, "#1f6feb".
onChange(hex: string) => voidCalled with hex as it changes.
presets{ label: string; color: string; }[]presetsLabelstringDefault 'Colours in use'fromPicture{ label: string; color: string; }[]pictureLabelstringDefault 'From the picture'idstringclassNamestringEach token reads a role, and the role lands on a value in each theme. Change the role and every component that reads it follows.
Space and shape
colorpick-gapgap-lg12px
colorpick-max-widthits own value
320px
colorpick-field-heightits own value
160px
colorpick-field-radiusradius-sm8px
colorpick-field-tintits own value
linear-gradient(to right,#fff,rgba(255,255,255,0))
colorpick-field-shadeits own value
linear-gradient(to top,#000,rgba(0,0,0,0))
colorpick-hue-heightits own value
12px
colorpick-hue-margin-xits own value
calc(16px / 2)
colorpick-hue-radiusradius-full9999px
colorpick-hue-spectrumits own value
linear-gradient(to right,#f00 0%,#ff0 16.67%,#0f0 33.33%,#0ff 50%,#00f 66.67%,#f0f 83.33%,#f00 100%)
colorpick-thumb-sizeits own value
16px
colorpick-thumb-radiusradius-full9999px
colorpick-thumb-ring-widthline-strong2px
colorpick-row-gapgap-md8px
colorpick-swatch-sizesize-control-sm36px
colorpick-swatch-radiusradius-sm8px
colorpick-swatch-ring-widthline-hairline1px
colorpick-hex-gapgap-2xs2px
colorpick-hex-heightsize-control-sm36px
colorpick-hex-padding-xinset-md12px
colorpick-hex-radiusradius-sm8px
colorpick-hex-ring-widthline-hairline1px
colorpick-hex-focus-ring-widthline-strong2px
colorpick-group-gapgap-sm6px
colorpick-forced-edge-widthline-hairline1px
colorpick-forced-focus-widthline-strong2px
colorpick-hue-target-sizespace-624px
Type
colorpick-hex-fonttext-body400 14px/20px "Funnel Sans", system-ui, -apple-system, "Segoe UI", sans-serif
colorpick-title-fonttext-small-strong600 12px/16px "Funnel Sans", system-ui, -apple-system, "Segoe UI", sans-serif
Checked automatically with axe-core 4.11.4 against WCAG 2.2 A and AA, on the live preview above, in light and dark, on 26 October 2026.
- Result
- No issues found, in light or in dark.
- By design
- A group named by
label. The field is a slider named "Saturation and brightness" that speaks both; arrows move it 1% (10% with Shift), left and right for saturation, up and down for brightness. The hue track is a slider named "Hue" in degrees: arrows by 1 (10 with Shift), Page Up and Page Down by 30, Home and End. The hex field is a text field named bylabeland "hex". Presets and picture colours are radio groups (see SwatchPicker), the chosen one checked when it matches. - Not tested
- The automated check doesn't test keyboard use, focus order or what a screen reader says. The lines above are the design system's own account of them.