# Color Picker [component-header:sl-color-picker] Color pickers allow the user to select a color. ```html preview ``` ```jsx react import { SlColorPicker } from '@shoelace-style/shoelace/dist/react'; const App = () => ; ``` ?> This component works with standard `
` elements. Please refer to the section on [form controls](/getting-started/form-controls) to learn more about form submission and client-side validation. ## Examples ### Opacity Use the `opacity` attribute to enable the opacity slider. When this is enabled, the value will be displayed as HEXA, RGBA, or HSLA based on `format`. ```html preview ``` ```jsx react import { SlColorPicker } from '@shoelace-style/shoelace/dist/react'; const App = () => ; ``` ### Formats Set the color picker's format with the `format` attribute. Valid options include `hex`, `rgb`, and `hsl`. Note that the color picker's input will accept any parsable format (including CSS color names) regardless of this option. To prevent users from toggling the format themselves, add the `no-format-toggle` attribute. ```html preview ``` ```jsx react import { SlColorPicker } from '@shoelace-style/shoelace/dist/react'; const App = () => ( <> ); ``` ### Sizes Use the `size` attribute to change the color picker's trigger size. ```html preview ``` ```jsx react import { SlColorPicker } from '@shoelace-style/shoelace/dist/react'; const App = () => ( <> ); ``` ### Inline The color picker can be rendered inline instead of in a dropdown using the `inline` attribute. ```html preview ``` ```jsx react import { SlColorPicker } from '@shoelace-style/shoelace/dist/react'; const App = () => ; ``` [component-metadata:sl-color-picker]