Color Picker
Use this component if you need to select a color.
Anchor to colorpickerpropsColorPickerProps
- Anchor to allowAlphaallowAlphabooleanDefault: false
Allow user to select an alpha value.
- string
ID for the element.
- Anchor to onChangeonChange(value: string) => void
The
handler will emit the value in hex. If theprop istrue,will emit an 8-value hex (#RRGGBBAA). If theprop isfalse,will emit a 6-value hex (#RRGGBB).- Anchor to valuevaluestring
The currently selected color.
Supported formats include:
- RGB
Examples

import {
render,
ColorPicker,
} from '@shopify/ui-extensions-react/admin';
render('Playground', () => <App />);
function App() {
return (
<ColorPicker
value="rgba(255 0 0 / 0.5)"
onChange={(value) => {
console.log({value});
}}
/>
);
}
Preview

Examples
Simple ColorPicker example
React
import { render, ColorPicker, } from '@shopify/ui-extensions-react/admin'; render('Playground', () => <App />); function App() { return ( <ColorPicker value="rgba(255 0 0 / 0.5)" onChange={(value) => { console.log({value}); }} /> ); }JS
import { extension, ColorPicker, } from '@shopify/ui-extensions/admin'; export default extension( 'Playground', (root) => { const blockStack = root.createComponent( ColorPicker, { value: "rgba(255 0 0 / 0.5)", label: "" }, ); root.appendChild(blockStack); }, );
Was this page helpful?