LayerInput is the flat, one-object authoring format for all ten layer types. Every place in the SDK that accepts a layer — decks.create, slides.create, layers.create, and layouts.create — accepts a LayerInput. The object is discriminated on type: set type to the kind of content you want and add the matching fields alongside the required at geometry.
The compiler validates your input through Zod, maps friendly input types ('bar', 'donut') to their stored representation ('chart'), and builds canonical structured documents for text, charts, and tables — you never write those by hand.
Common fields
Every layer type shares these fields.Layer geometry in 1920×1080 slide coordinates.
Integer stacking order (z-index). Higher values render on top of lower values. When omitted, the server assigns a value based on insertion order.
AI brief — a plain-language instruction for what the AI should generate for this layer. Stored in layer metadata and read by Ablo’s generation pipeline.
Sample outputs that guide AI generation for this layer. Each string is one example of the content you expect.
Visual effects applied to the layer box: opacity, corner radius, blur, vertical alignment, and drop shadows.
type: 'text'
A text layer. The text field accepts a single string or an array of strings (each string becomes a paragraph).
The content. An array of strings produces multiple paragraphs.
type: 'bullets'
A bullet list. Each string in items becomes one bullet point.
List items. Must contain at least one item.
type: 'numbered'
A numbered list. Each string in items becomes one numbered item.
List items. Must contain at least one item.
type: 'bar'
A bar chart (vertical or horizontal). The SDK compiles this into a full ChartDocument and stores it as a 'chart' layer.
Chart data. Each datum has
label (string), value (number), and an optional color override.Optional chart title rendered above the chart.
Bar direction. Default is
'vertical'.D3-style number format string, e.g.
'$0.0"M"', '0,0', '0%'.Show value labels on each bar.
Render a CAGR arrow between the first and last bar.
type: 'donut'
A donut chart. Compiles to a 'chart' layer.
Slice data — same shape as bar chart data.
Optional center label.
Number format string for slice labels.
Show labels on each slice.
type: 'chart'
The full chart API — every chart family (bar, stacked bar, line, combo, pie, donut, waterfall, funnel, scatter, bubble, mekko, gantt, range) with full control over datasets, marks, encodings, scales, axes, legend, and affordances. Pass a CreateChartDocumentInput — the same input the Ablo chart toolkit accepts.
The full chart structure. Validated against the
ChartDocumentSchema at compile time; family-default affordances are filled in automatically.type: 'bar' and type: 'donut' for the common cases. Use type: 'chart' when you need a chart family or configuration option those shortcuts don’t expose.
type: 'table'
A data table. Columns can carry alignment, width, and per-column style; cells can be plain values or rich objects with colspan/rowspan.
Column definitions. Pass a bare string for a simple header, or an object with
{ header, key?, align?, verticalAlign?, width?, style? } for full control. Column keys are auto-generated from headers if omitted.Row data. Each row is an array of cell values aligned to the columns. Cells can be a string, number,
null, or a rich { text?, content?, align?, verticalAlign?, backgroundColor?, colSpan?, rowSpan? } object.Number of header rows at the top (default 1). These rows receive the
styles.header style.type: 'image'
An image layer. Stored internally as a 'shape' layer with an imageFill. External URLs are automatically rehosted to the Ablo CDN at commit time. Use ablo.images.upload() for local files.
A valid HTTPS URL. External URLs are rehosted to the Ablo CDN on commit.
How the image fills its bounding box. Default is
'cover'.Intrinsic width hint in pixels.
Intrinsic height hint in pixels.
type: 'shape'
A vector shape — rectangle, circle, ellipse, triangle, or line. Supports solid fills, CSS gradients, structured fill stacks, opacity, stroke, and corner radius.
The shape kind.
Solid fill color as a CSS color string.
Raw CSS gradient string, e.g.
'linear-gradient(135deg, #667eea, #764ba2)'.Structured fill stack — an array of
Fill objects (solid, gradient, image, shader). Rendered bottom-to-top. See Fills Reference.Fill opacity from
0 (transparent) to 1 (opaque). Does not affect stroke.Stroke color as a CSS color string.
Stroke thickness in pixels.
Corner radius in pixels (rectangles only).
Line start X, relative to the layer box in 0–1 coordinates (lines only).
Line start Y (lines only).
Line end X (lines only).
Line end Y (lines only).
Add an arrowhead at the start of the line.
Add an arrowhead at the end of the line.
type: 'icon'
An SVG icon layer from the Ablo icon library.
Icon key, e.g.
'rocket', 'bar-chart', 'arrow-right', 'check-circle'.Icon color. Accepts any CSS color or theme variable.