ColorSwatch API

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

Props

Props

Type

Description

Default

ariaLabelPrefix?

string

Used as a prefix for the aria-label of the swatch

_

background

string

The background color for the swatch

_

inputName?

string

Used as the HTML 'name' attribute for the swatch input

_

onChange?

(value: string) => void

Callback function that is called when the color changes

_

size?

'20' | '24' | '28' | '32' | '36' | '40'

The width and height of the swatch

'32'

value

string

The currently selected color value

_