@mocanvas/mocanvas · interface

StylePanelContext

interface StylePanelContext

What every picker needs: the styles in play, and how to change one.

Published as context rather than passed down, so a caller can compose the panel out of individual pickers — or drop one into a contextual toolbar — without re-plumbing the same three things into each.


Methods · 1

setStyle<T>(style: StyleProp<T>, value: T): void

Apply a style to the selection, or to the next shape when nothing is selected.


Properties · 3

disabled: boolean

Whether the editor refuses edits.

isMobile: boolean

Whether the panel is in its compact, popover-hosted form.

styles: ReturnType<typeof useRelevantStyles>

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.