Garden 9 is now available.
The website has been updated to the latest major version. View previous versions
Skip to main content
Design
Components
Patterns
    • Introduction
      • Overview
    • Foundations
      • Bedrock CSS
      • Design tokens
      • Containers
      • Theming
      • Versions
    • Components
      • Accordion
      • Anchor
      • Avatar
      • Breadcrumbs
      • Buttons
      • Chrome
      • Code block
      • Color picker
      • Color swatch
      • Date picker
      • Draggable
      • Drawer
      • Forms
      • Grid
      • Loaders
      • Menu
      • Modal
      • Notification
      • Pagination
      • Pane
      • Sheet
      • Status indicator
      • Stepper
      • Table
      • Tabs
      • Tags
      • Tiles
      • Timeline
      • Tooltip
      • Tooltip dialog
      • Typography
      • Well
    Table of Contents
    • How to use it
      • Default
      • Custom trigger
      • Dialog
      • Form input
      • Opaque
    • Configuration
    • API
      • ColorPicker
      • ColorPickerDialog

    Color picker

    The Color picker allows users to choose colors using sliders and input fields.


    Table of Contents
    • How to use it
      • Default
      • Custom trigger
      • Dialog
      • Form input
      • Opaque
    • Configuration
    • API
      • ColorPicker
      • ColorPickerDialog

    Used for this
    • To let users change or update brand colors
    • To let users configure chart colors

    How to use it

    Default

    The Color picker allows users to choose colors using sliders and input fields.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Custom trigger

    The Color picker can be displayed using a trigger, e.g. an icon button.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Dialog

    The Color picker can be shown inside a dialog using <ColorPickerDialog>.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Form input

    The Color picker dialog can be used in an input group.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Opaque

    Remove alpha transparency using the isOpaque prop.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Configuration

    • Name9.5.3•View source•View on npm
    • Installnpm install @zendeskgarden/react-colorpickers
    • Depsnpm install react react-dom styled-components @zendeskgarden/react-theming
    • Importimport { ColorPicker, ColorPickerDialog } from '@zendeskgarden/react-colorpickers'

    API

    ColorPicker

    Extends HTMLAttributes<HTMLDivElement>

    Prop nameTypeDefaultDescription
    color
    string | IColor

    Sets the color for a controlled color picker

    defaultColor
    string | IColor
    #fff

    Sets the color for an uncontrolled color picker

    isOpaque
    boolean

    Hides alpha transparency fields

    labels
    { hueSlider?: string; alphaSlider?: string; hex?: string | undefined; red?: string | undefined; green?: string | undefined; blue?: string | undefined; alpha?: string | undefined; } | undefined
    {}

    Replaces label text within the color picker

    onChange
    ((color: IColor) => void)

    Handles color picker changes

    Parameters
    color

    A color picker state

    ColorPickerDialog

    Extends HTMLAttributes<HTMLDivElement>

    Prop nameTypeDefaultDescription
    buttonProps
    HTMLAttributes<HTMLButtonElement>

    Passes HTML attributes to the color dialog button element

    color
    string | IColor

    Sets the color for a controlled color picker

    defaultColor
    string | IColor

    Sets the color for an uncontrolled color picker

    disabled
    boolean

    Disables the color dialog button

    focusInset
    boolean

    Applies inset box-shadow styling on focus

    hasArrow
    boolean
    false

    Adds an arrow to the color dialog

    isAnimated
    boolean
    true

    Animates the color dialog

    isOpaque
    boolean

    Hides alpha transparency fields

    isOpen
    boolean

    Opens the dialog in a controlled color picker dialog

    labels
    { hueSlider?: string; alphaSlider?: string; hex?: string | undefined; red?: string | undefined; green?: string | undefined; blue?: string | undefined; alpha?: string | undefined; } | undefined

    Replaces label text within the color picker

    onChange
    ((color: IColor) => void)

    Handles color picker changes

    Parameters
    color

    A color picker state

    onClose
    ((color: IColor) => void)

    Handles close actions. Can be triggered from the backdrop.

    Parameters
    color

    A color picker state

    onDialogChange
    ((changes: { isOpen: boolean; }) => void)

    Handles dialog changes

    Parameters
    changes

    The changed dialog state

    placement
    'end' | 'start' | 'auto' | 'top' | 'bottom' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'end-top' | 'end-bottom' | 'start-top' | 'start-bottom'
    'bottom-start'

    Adjusts the placement of the color dialog

    zIndex
    number
    1000

    Sets the z-index of the color dialog

    Garden is the design system by Zendesk.
    BlogGitHubVersions
    © Zendesk 2025