ColorSwatch API

API reference docs for theColorSwatchcomponent. For examples and details on the usage of this component, visit the component demo page.

Props

PropsTypeDescriptionDefault
ariaLabelPrefix?stringUsed as a prefix for the aria-label of the swatch_
backgroundstringThe background color for the swatch_
inputName?stringUsed as the HTML 'name' attribute for the swatch input_
onChange?(value: string) => voidCallback function that is called when the color changes_
size?'20' | '24' | '28' | '32' | '36' | '40'The width and height of the swatch'32'
valuestringThe currently selected color value_