Configuring built-in shapes

Some of the builtin tldraw shapes can be customized to behave differently based on your needs. This is done via the ShapeUtil.configure function which returns a new version of the shape's util class with custom options specified.

This example shows how to configure the built-in frame shape to support colorful borders and labels.

import { FrameShapeUtil, Tldraw } from 'tldraw'
import 'tldraw/tldraw.css'

const shapeUtils = [FrameShapeUtil.configure({ showColors: true })]

export default function ConfigureShapeUtilExample() {
	return (
		<div className="tldraw__editor">
			<Tldraw shapeUtils={shapeUtils}></Tldraw>
		</div>
	)
}
Is this page helpful?
Prev
Static assets
Next
Persistence key

We use cookies on this website.
Learn more in our Cookie Policy.