Docs

API reference

Shape

Draw a field, rule, highlight, or simple geometric visual.

presentation.tsx

<Shape id="accent" x={8} y={30} w={5} h={48} shape="rectangle" fill="#7C3AED" stroke="transparent" strokeWidth={0} radius={8} />

Props reference

Keep these values literal and serializable so Canvas, Inspector, validation, and export can process them reliably.

APIPropertyType / valuesRequiredDescription
Shared native-layer propsidstringYesStable, unique layer identifier. Required for every visible native layer.
xnumberYesLeft position as a percentage of the slide canvas.
ynumberYesTop position as a percentage of the slide canvas.
wnumberYesFrame width as a percentage of the slide canvas.
hnumberYesFrame height as a percentage of the slide canvas.
groupIdstring—Groups native children without adding a wrapper element.
groupNamestring—Human-readable name for a group in Workbench.
sharedIdstring—Matches the same layer type across adjacent Morph slides; unique within each slide.
rotationnumber—Clockwise rotation in degrees.
opacitynumber—Layer opacity from 0 to 1.
motionJSON string—Versioned declarative action sequence. Keep a complete static final frame.
interactionJSON string—Versioned click interaction for slide navigation or a link.
Shapeshaperectangle | circle | triangle | diamond | star | line | arrow | chevron | hexagon | parallelogramYesGeometry to draw.
fillcolor string—Interior color.
strokecolor string—Outline or line color.
strokeWidthnumber—Outline or line width.
radius / borderRadiusnumber—Rounded rectangle corner radius.
cornernumber—Continuous-corner treatment.
points / sidesnumber—Star points or polygon sides.
lineStylesolid | dashed | dotted—Line stroke pattern.
arrowStart / arrowEndnone | arrow | circle | bar—Line endpoint decorations.
arrowStartSize / arrowEndSizenumber—Endpoint size as a percentage.
shapeImageSrcstring—Optional image clipped inside a non-line shape.
shapeImageAltstring—Description for the shape image.
shapeImageFitcover | contain | fill | scale-down—How the shape image fills its geometry.
shapeImageCropX / shapeImageCropY / shapeImageScaleX / shapeImageScaleYnumber—Shape-image crop and scale controls.
masknone | alpha | luma | clip—Shape mask mode.
operationnone | subtract | intersect | exclude—Shape boolean treatment.

Required syntax

Use id, x, y, w, h, and shape. rectangle, circle, line, diamond, and star are used by the official references.

Common styling

Use fill, stroke, strokeWidth, radius, rotation, and points as literal values. A stable sharedId may connect compatible same-type shapes across adjacent Morph slides.