Skip to content
v0.2.10

ColorSwatch

A named sample of an opaque RGB color.

Preview

Use ColorSwatch

ColorSwatch 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-swatch.tsxTSX
"use client";

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

export function Example() {
  return (
    <FloodRoot>
      <ColorSwatch label="Flood pink" value="#ff47a8" />
    </FloodRoot>
  );
}

Design notes

  • Opaque RGB colors only; keep a text label wherever color conveys meaning.

API reference

PropValuesDefault
valuestringRequired
labelstringRequired
size"sm" | "md" | "lg"—
Native HTML propsOmit<HTMLAttributes<HTMLSpanElement>, "children" | "color">Forwarded
View TypeScript source