Blossom UI

Color picker

Color picker component with a saturation and brightness area, a hue bar, a hex field, presets, inline mode and keyboard support.

How to use it

Run npx @blossomui/react add color-picker, or copy src/components/UI/ColorPicker/ColorPicker.tsx into your React project and import it.

import { ColorPicker } from './components/ui/ColorPicker'

Props

ColorPickerLabels

PropTypeDescription
choose (required)stringAccessible name of the panel.
area (required)stringAccessible name of the area that sets saturation and brightness.
hue (required)string
hex (required)string

ColorPickerProps

PropTypeDescription
labelsPartial<ColorPickerLabels>Texts of the component. Pass only the ones you want to change, for example to translate it.
valuestringControlled color as a hex string, for example `#f472b6`. Use together with `onChange`.
defaultValuestringInitial color when the picker is not controlled.
onChange(color: string) => voidCalled with the color as `#rrggbb`.
labelstring
hintstringHelper text shown under the field.
errorstringError message. It is shown in red under the field.
presetsstring[]Ready-made colors shown under the picker.
inlinebooleanShow the panel in the page instead of in a popover opened by a field.
areabooleanShow the area for saturation and brightness. Turn it off for a compact picker with only the hue bar, the hex field and the presets.
disabledboolean

Getting started

  • Introduction
  • Installation
  • Changelog

Customization

  • Colors
  • Brand color
  • Texts and translation

Components

  • Accordion
  • Alert dialog
  • Alerts
  • Avatar
  • Badges
  • Banner
  • Breadcrumb
  • Buttons
  • Calendar
  • Cards
  • Carousel
  • Charts
  • Chip input
  • Collapsible
  • Color picker
  • Combobox
  • Command palette
  • Context menu
  • Copy button
  • Date picker
  • Drawer
  • Dropdown
  • Empty state
  • File upload
  • Footer
  • Forms
  • Hover card
  • Jumbotron
  • KBD
  • Menubar
  • Modal
  • Navbar
  • Navigation menu
  • Number input
  • OTP input
  • Pagination
  • Popover
  • Pricing
  • Progress
  • Rating
  • Resizable panels
  • Scroll area
  • Segmented control
  • Separator
  • Sidebar
  • Skeleton
  • Slider
  • Spinners
  • Stats
  • Stepper
  • Survey
  • Table
  • Tabs
  • Time picker
  • Timeline
  • Timer button
  • Toasts
  • Tooltip
  • Transfer list
  • Tree