You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| children | renderable elements |`null`| Will include components such as `wrapShape`-wrapped shapes, other library components (`SelectionLayer`/`ImageLayer`/`DrawLayer`) or arbitrary SVG elements |
16
+
| focusOnAdd |`bool`|`true`| If `true`, focus on newly created elements. |
17
+
| focusOnDelete |`bool`|`true`| If `true`, focus on the next-closest element after a shape is deleted. |
18
+
| scale |`number`|`1`| Scale factor of the svg contents. For example, given a `vectorWidth` of `100` and a scale of `0.5`, the rendered DOM element will be 50 px wide. |
19
+
| style |`object`|`{}`| Style to apply to the `<svg>` element. |
20
+
| vectorHeight |`number`|`0`| Height of the `<svg>` element viewBox. |
21
+
| vectorWidth |`number`|`0`| Width of the `<svg>` element viewBox. |
22
+
23
+
---
24
+
25
+
### ImageLayer
26
+
27
+
Renders an svg image element.
28
+
29
+
| Prop | Type | Default | <divstyle="width: 400px;">Description</div> |
| disabled |`bool`| If `true`, the shape cannot be moved or resized, and shows no resize handles. |
65
+
| isBeingChanged |`bool`| If `true`, the shape is currently being moved or scaled. |
66
+
| scale |`number`| Scale of the parent `<svg>` element, provided so you can render strokes or other components that maintain a constant size at every zoom level. |
67
+
68
+
**WrappedShape Props**
69
+
70
+
| Prop | Type | Default | <divstyle="width: 400px;">Description</div> |
| height<br/>_(required)_|`number`|| Height of the shape. |
73
+
| shapeId<br/>_(required)_|`string`|| Unique identifier for the shape, to aid in data handling. |
74
+
| width<br/>_(required)_|`number`|| Width of the shape. |
75
+
| x<br/>_(required)_|`number`|| x-axis offset of the shape. |
76
+
| y<br/>_(required)_|`number`|| y-axis offset of the shape. |
77
+
| active |`bool`|`false`| If `true`, the shape is rendered as focused (particularly important when using a `SelectionLayer`). When not using a selection layer, this prop can be left unset, as native HTML focus will handle focus state. |
78
+
| constrainMove |`func`| non-constraining function | A callback for restricting movement during shape transformations (e.g., to lock movement to one axis or snap it to a grid). Signature: `({ originalX: number, originalY: number, x: number, y: number, width: number, height: number }) => ({ x: number, y: number })`|
79
+
| constrainResize |`func`| non-constraining function | A callback for restricting resizing during shape transformations (e.g., to lock resizing to one axis or snap it to a grid). Signature: `({ originalMovingCorner: { x: number, y: number }, startCorner: { x: number, y: number }, movingCorner: { x: number, y: number }, lockedDimension: one of "x" or "y" }) => ({ x: number, y: number })`|
80
+
| disabled |`bool`|`false`| If `true`, the shape cannot be moved or resized, and shows no resize handles. |
0 commit comments