DocMosaicdocs
Primitives

Editor.ShapeToolButton

Toolbar toggle that arms the draw-to-size shape tool (rectangle, circle, line).

Toolbar toggle that arms the draw-to-size shape tool. While armed, dragging on the page rubber-bands a new ShapeSection; a small caret picks the primitive (rectangle, circle, or line). Mutually exclusive with the frame, image-frame, and drawing tools, and it renders in its active variant while armed.

Usage

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

<Editor.Root>
    <Editor.ShapeToolButton />
</Editor.Root>;

API Reference

PropTypeDefaultDescription
iconOnlyboolean | undefined-

Render a compact icon-only square button with an accessible label.

variant"default" | "cream" | "sage" | "orange" | "caramel" | "white" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined-

Override the idle (not-armed) variant. Defaults to 'caramel'.

activeVariant"default" | "cream" | "sage" | "orange" | "caramel" | "white" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined-

Override the armed (drawing) variant. Defaults to 'orange'.

classNamestring | undefined-

Extra classes merged onto the toggle button while idle.

activeClassNamestring | undefined-

Extra classes merged onto the toggle button while the tool is armed.