Color Picker

Added: 2.5.0 | Last updated: 2.6.0 (09/06/2024)

Usage

import { ColorPicker } from "@valence-ui/core";

function MyComponent() { 
    const [value, setValue] = React.useState("red");

    return ( 
        <ColorPicker
            value={value}
            setValue={setValue}
        />
    )
}

Props

Extends GenericInputProps<string> and ColorPickerEventProps.

colors

Color[]

A list of colors to choose from. If left unset, will use the theme default color list.

excludeColors

string[]

A list of color keys to exclude from the colors list. Defaults to ["permaWhite", "permaBlack", "white", "darkerBlack", "brighterWhite"].

gap

number

Sets the gap between colors. 5 by default.

wrap

CSSProperties["flexWrap"]

How the colors will wrap within the container. Defaults to "nowrap".

swatchMotion

MotionBehaviourProps

Motion props to apply to the swatch buttons.

Last updated

Was this helpful?