@mocanvas/mocanvas · interface

ToolbarItemProps

interface ToolbarItemProps

The toolbar's buttons, one exported component per tool.

They are components rather than a data list so a caller can compose its own bar out of exactly the tools it wants — <DrawToolbarItem /> <EraserToolbarItem /> — while each button keeps the behaviour that makes it correct: it reads the tool from the UI tool list, so it disappears when the tool is not registered, follows an override's relabelling, and shows itself as pressed when its tool is the current one.


Properties · 3

icon?: string

Override the item's own icon.

label?: string

Override the item's own label.

tool: string

The id of an entry in the UI tool list.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.