DocMosaicdocs
Primitives

Editor.AddShapeButton

Toolbar button that inserts a new shape section (rect, ellipse, or line).

Toolbar button that inserts a new shape section (rect, ellipse, or line).

Usage

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

<Editor.Root>
    <Editor.AddShapeButton />
</Editor.Root>;

API Reference

PropTypeDefaultDescription
shapeenum-

Which shape primitive to insert. Defaults to 'rect'.

labelstring | undefined-

Override the displayed label. Defaults to "Add Rectangle/Circle/Line".

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 icon-only button variant. Defaults to 'caramel'.

classNamestring | undefined-

Extra classes merged onto the icon-only button.

  • Root - the orchestrator