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.At
required
Layer geometry in 1920×1080 slide coordinates.
number
Integer stacking order (z-index). Higher values render on top of lower values. When omitted, the server assigns a value based on insertion order.
string
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.
string[]
Sample outputs that guide AI generation for this layer. Each string is one example of the content you expect.
EffectsInput
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).
"text"
required
string | string[]
required
The content. An array of strings produces multiple paragraphs.
type: 'bullets'
A bullet list. Each string in items becomes one bullet point.
"bullets"
required
string[]
required
List items. Must contain at least one item.
type: 'numbered'
A numbered list. Each string in items becomes one numbered item.
"numbered"
required
string[]
required
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.
"bar"
required
ChartDatum[]
required
Chart data. Each datum has
label (string), value (number), and an optional color override.string
Optional chart title rendered above the chart.
'vertical' | 'horizontal'
Bar direction. Default is
'vertical'.string
D3-style number format string, e.g.
'$0.0"M"', '0,0', '0%'.boolean
Show value labels on each bar.
boolean
Render a CAGR arrow between the first and last bar.
type: 'donut'
A donut chart. Compiles to a 'chart' layer.
"donut"
required
ChartDatum[]
required
Slice data — same shape as bar chart data.
string
Optional center label.
string
Number format string for slice labels.
boolean
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.
"chart"
required
CreateChartDocumentInput
required
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.
"table"
required
(string | ColumnDef)[]
required
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.CellInput[][]
required
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
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.
"image"
required
string
required
A valid HTTPS URL. External URLs are rehosted to the Ablo CDN on commit.
'cover' | 'contain' | 'fill'
How the image fills its bounding box. Default is
'cover'.number
Intrinsic width hint in pixels.
number
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.
"shape"
required
'rectangle' | 'circle' | 'ellipse' | 'triangle' | 'line'
required
The shape kind.
string
Solid fill color as a CSS color string.
string
Raw CSS gradient string, e.g.
'linear-gradient(135deg, #667eea, #764ba2)'.Fill[]
Structured fill stack — an array of
Fill objects (solid, gradient, image, shader). Rendered bottom-to-top. See Fills Reference.number
Fill opacity from
0 (transparent) to 1 (opaque). Does not affect stroke.string
Stroke color as a CSS color string.
number
Stroke thickness in pixels.
number
Corner radius in pixels (rectangles only).
number
Line start X, relative to the layer box in 0–1 coordinates (lines only).
number
Line start Y (lines only).
number
Line end X (lines only).
number
Line end Y (lines only).
boolean
Add an arrowhead at the start of the line.
boolean
Add an arrowhead at the end of the line.
type: 'icon'
An SVG icon layer from the Ablo icon library.
"icon"
required
string
required
Icon key, e.g.
'rocket', 'bar-chart', 'arrow-right', 'check-circle'.string
Icon color. Accepts any CSS color or theme variable.