Workspace
is essential part of Polotno
framework. It is the main React
component that you are going to use to display the drawings and interact with them. You can change canvas and its content programmatically using Store API.
The Workspace
will automatically take full width and height of its parent, so you don't have adjust its size manually. You can just setup the size of parent <div>
with CSS.
Customize page controls
You can customize page controls of your <Workspace />
component. You can remove some buttons, add new one, etc. You are in total control on what else you want to see around page on the canvas.
Take a look into Page Name Demo to see controls component in action.
Hide page controls
Optionally you can hide UI to add/remove/duplicate pages.
Workspace styling
Optionally, you can change some styles of the workspace.
Change default styles of Transformer (resize tool) and Highlighter (on object select or hover).
Show only the current page in Workspace
You can you renderOnlyActivePage
property to show only one page in the workspace.
No pages UI
If your store
has no pages, <Workspace />
component will show a simple UI with a button to create a new page. You can overwrite this UI with your own.
Overwrite keyboard handler
If you don't like default keyboard shortcuts, you can overwrite them with your own.