Components

Colorpicker

Usage

const brandColor = await io.input.colorpicker('Brand color')
console.log(brandColor) // #252DBA

Parameters

labelrequired
string

The label to render above the input.

options { ... }
defaultValue
string

Default value rendered in input. Default '#FFFFFF'.

inline
boolean

Display the panel input inline rather than a popover. Default true.

format
'hex' | 'hsla' | 'rgba'

Input format to display. Default 'hex'.

outputFormat
'hex' | 'hsla' | 'rgba'

Output format convert to. Default 'hex'.

eyeDropper
boolean

Render eyedropper input. Default false.

alpha
boolean

Allow alpha panel. Default true.

disabled
boolean

Disables user input. Default false.

help
string

The small help text to render below the input. Default undefined.

customValidator
(input: unknown) => Promise<string | true>

An asynchronous function that takes unknown input and outputs either true or an error message string to show the user.