DocMosaicdocs
Primitives

Editor.ColorPicker

Drawing-mode color swatch grid for stroke color.

Drawing-mode color swatch grid for stroke color.

Usage

import { Editor } from '@docmosaic/react';

<Editor.Root>
    <Editor.ColorPicker />
</Editor.Root>;

API Reference

PropTypeDefaultDescription
value *string-

Currently-selected color (CSS color string).

onChange *(color: string) => void-

Fired when the user picks a swatch or commits a custom color.

presetsreadonly string[] | undefined-

Optional override for the swatch palette. Defaults to DEFAULT_COLOR_PRESETS (12 colors).

classNamestring | undefined--
disabledboolean | undefined-

When true, the swatches and custom-color trigger become non-interactive and visually dim. The current value still shows so the swatch remains a label for the actively-selected color.

  • Root - the orchestrator