Skip to content
v0.2.10

ColorPicker

An RGB color editor with hex input, channel sliders and reusable presets.

Preview
Red
Green
Blue

Use ColorPicker

ColorPicker is a named export of @flood-md/react. Connect the package once, then import what you use.

First time here? Connect Flood
Example import style
color-picker.tsxTSX
"use client";

import { FloodRoot, ColorPicker } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <ColorPicker label="Accent color" defaultValue="#ff47a8" name="accent" presets={["#ff47a8", "#ffffff", "#78b8ff"]} />
    </FloodRoot>
  );
}

Design notes

  • Uses #rrggbb values without alpha or gradients.
  • The hex field owns native form validation; RGB controls provide an additional editing path.

API reference

PropValuesDefault
labelstringRequired
hideLabelboolean—
valuestring—
defaultValuestring—
onValueChange(value: string) => void—
namestring—
formstring—
requiredboolean—
disabledboolean—
readOnlyboolean—
controlSize"sm" | "md" | "lg"—
presetsreadonly string[]—
invalidMessagestring—
hexLabelstring—
channelLabelsreadonly [string, string, string]—
presetsLabelstring—
Native HTML propsOmit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange" | "children">Forwarded
View TypeScript source