Skip to Content
API ReferenceLayer Types

Layer types

When rendering with a custom canvas + layers payload (see POST /v1/render), each entry in layers is one of four types: text, image, qrcode, or shape. Layers are drawn in array order — later entries are drawn on top of earlier ones.

Shared fields

Every layer type accepts:

FieldTypeRequiredDescription
typestringYes"text" | "image" | "qrcode" | "shape"
idstringNoYour own identifier for the layer (not used by the engine)
namestringNoA human-readable label (shown in the dashboard’s Template Studio, has no rendering effect)
x / ynumberYesTop-left position in pixels
width / heightnumberYesSize in pixels
opacitynumberNo01
rotationnumberNoDegrees
shadowobjectNo{ color?, blur?, offsetX?, offsetY? }

text

FieldTypeDescription
textstringThe string to render
fontFamilystringFont name. Drawtab ships a bundled font set; customFontUrl lets you use any other font
customFontUrlstringURL to a font file to load for this layer
fontSizenumberPoint size
minFontSizenumberFloor used when autoFit shrinks text to fit its box
fontWeightstring"normal" | "bold" | "100""900"
fontStylestring"normal" | "italic"
colorstringHex/RGB color
textAlignstring"left" | "center" | "right"
verticalAlignstring"top" | "middle" | "bottom"
lineHeightnumberLine height multiplier
letterSpacingnumberPixels between characters
maxLinesnumberTruncate after this many lines
wrapbooleanWrap text within width
autoFitbooleanShrink fontSize down to minFontSize so the text fits its box
textTransformstring"none" | "uppercase" | "lowercase" | "capitalize"
textDecorationstring"none" | "underline" | "line-through"
strokeobject{ color?, width? } — an outline around the text
{ "type": "text", "x": 40, "y": 160, "width": 720, "height": 100, "text": "Hello, world", "fontFamily": "Inter", "fontSize": 48, "fontWeight": "bold", "color": "#ffffff", "textAlign": "center", "autoFit": true }

image

FieldTypeDescription
urlstringA publicly reachable image URL
maskstring"none" | "circle" | "squircle" | "rounded"
borderRadiusnumberUsed with mask: "rounded"
fitstring"cover" | "contain" | "fill"
borderobject{ color?, width? }
fallbackColorstringBackground shown if url fails to load
{ "type": "image", "x": 60, "y": 60, "width": 100, "height": 100, "url": "https://example.com/avatar.jpg", "mask": "circle", "fit": "cover" }

qrcode

FieldTypeDescription
datastringThe value to encode (a URL, plain text, etc.)
colorDarkstringForeground module color. Default #000000
colorLightstringBackground color. Default #ffffff
marginnumberQuiet-zone size, in modules
errorCorrectionLevelstring"L" | "M" | "Q" | "H"
borderRadiusnumberRounds the QR code’s bounding box
{ "type": "qrcode", "x": 900, "y": 60, "width": 120, "height": 120, "data": "https://drawtab.app", "errorCorrectionLevel": "M" }

shape

FieldTypeDescription
shapeTypestring"rectangle" | "rounded_rectangle" | "circle" | "pill" | "line"
fillColorstringFill color
borderobject{ color?, width? }
borderRadiusnumberUsed with shapeType: "rounded_rectangle"
{ "type": "shape", "x": 0, "y": 380, "width": 1200, "height": 250, "shapeType": "rectangle", "fillColor": "#0f172a", "opacity": 0.6 }