SwiftUI.js
Components

ColorPicker

ColorPicker wraps the native color input while keeping SwiftUI-style label and value semantics.

ColorPicker wraps the native color input while keeping SwiftUI-style label and value semantics.

Examples

Default

Preview unavailable for this example in the static docs build.

Show code
function DemoColorPicker() {
  const [value, setValue] = useState('#0a84ff')

  return <ColorPicker label="Accent" onChange={setValue} value={value} />
}

API

PropTypeRequiredDescription
labelstringYesAccessible label shown next to the color control.
valuestringYesCurrent color value.
onChange(value: string) => voidYesCalled when the selected color changes.

Inherits additional props from IBaseComponent.

Overview

ColorPicker wraps the native color input while keeping SwiftUI-style label and value semantics.

On this page