@firecms/ui
Version:
Awesome Firebase/Firestore-based headless open-source CMS
32 lines (31 loc) • 936 B
TypeScript
import React from "react";
import { ChipColorKey } from "./Chip";
export interface ColorPickerProps {
/**
* Currently selected color key
*/
value?: ChipColorKey;
/**
* Callback when color selection changes. Passes undefined when "Auto" is selected.
*/
onChange: (colorKey: ChipColorKey | undefined) => void;
/**
* Size of the color swatches
*/
size?: "small" | "medium";
/**
* Whether to show the "Auto" option that clears the selection
*/
allowClear?: boolean;
/**
* Whether the picker is disabled
*/
disabled?: boolean;
}
/**
* A color picker component that displays a grid of predefined CHIP_COLORS.
* Used for selecting colors for enum values, tags, and other chip-based UI elements.
*
* @group Form components
*/
export declare function ColorPicker({ value, onChange, size, allowClear, disabled }: ColorPickerProps): React.JSX.Element;