ReferenceAPI
Layouts in code (compose)
Ready-made slide layouts (recipes) and the building blocks they're made of.
Ready-made slide layouts (recipes) and the building blocks they’re made of. The same text agents read through help().
compose
Section titled “compose”compose(slide, tree, options?: ComposeOptions): ComposeResultLays out a tree of rows, columns, grids and boxes on a slide and turns it into ordinary native objects (text boxes, shapes, pictures, tables, charts), positioned and named: compose(slide, <column padding={64} gap={24}>…</column>).
Options: ComposeOptions.
compose(deck.slides.add(), h(KpiCards, { title: "Q3 at a glance", kpis: [{ label: "Revenue", value: "$87M" }] }))h(node | Recipe, props, ...children)Plain-function form, for scripts without a JSX build step: h("column", { gap: 16 }, h("text", {}, "Hi")). Components (recipes included) work too: h(TitleSlide, { title: "Q3" }).
h("column", { gap: 16, padding: 64 }, h("text", { className: "text-4xl font-bold" }, "Title"))recipes.Agenda
Section titled “recipes.Agenda”compose(slide, h(Agenda, props))Numbered agenda; the current item stands out.
| Option | Type | Description |
|---|---|---|
items (required) |
string[] |
|
current |
number |
|
title |
string |
recipes.BeforeAfter
Section titled “recipes.BeforeAfter”compose(slide, h(BeforeAfter, props))Before and after, with an arrow between.
| Option | Type | Description |
|---|---|---|
title (required) |
string |
|
eyebrow |
string |
|
before (required) |
{ heading?: string; points: string[] } |
|
after (required) |
{ heading?: string; points: string[] } |
recipes.BigNumber
Section titled “recipes.BigNumber”compose(slide, h(BigNumber, props))One number that tells the story.
| Option | Type | Description |
|---|---|---|
value (required) |
string |
|
label (required) |
string |
|
context |
string |
|
eyebrow |
string |
recipes.ChartTakeaway
Section titled “recipes.ChartTakeaway”compose(slide, h(ChartTakeaway, props))A chart with the takeaways beside it.
| Option | Type | Description |
|---|---|---|
title (required) |
string |
|
eyebrow |
string |
|
chart (required) |
Omit<ChartProps, keyof LayoutProps | "categories"> & { categories?: ChartProps["categories"]; format?: string } |
The chart: type, categories and series, plus any chart option (totals, bins, axes, …); format is short for axes.y.format. |
takeaways (required) |
string[] |
|
figure |
{ value: string; label: string } |
The one figure the chart is about, large above the takeaways: { value: "3.7%", label: "CPI, September 2026" }. Leave it out when the headline already says it or no single figure leads. |
note |
string |
The source, period or unit, in small type under the chart. |
recipes.Closing
Section titled “recipes.Closing”compose(slide, h(Closing, props))Closing slide: thank-you or call to action, with contact lines.
| Option | Type | Description |
|---|---|---|
title (required) |
string |
|
subtitle |
string |
|
contact |
string[] |
recipes.ComparisonTable
Section titled “recipes.ComparisonTable”compose(slide, h(ComparisonTable, props))A comparison or data table with an optional note, and the points to take from it.
| Option | Type | Description |
|---|---|---|
title (required) |
string |
|
eyebrow |
string |
|
rows (required) |
Array<Array<string | number>> |
|
takeaways |
string[] |
Up to three points the reader should take from the table: beside a narrow table, under a wide one or when there is one. |
note |
string |
recipes.Faq
Section titled “recipes.Faq”compose(slide, h(Faq, props))Questions and answers in two columns.
| Option | Type | Description |
|---|---|---|
title |
string |
|
items (required) |
Array<{ q: string; a: string }> |
recipes.ImageText
Section titled “recipes.ImageText”compose(slide, h(ImageText, props))A picture beside text (left or right).
Options: Bullet.
| Option | Type | Description |
|---|---|---|
title (required) |
string |
|
image (required) |
ImageOptions["source"] |
|
alt (required) |
string |
|
bullets |
Bullet[] |
|
body |
string |
|
side |
"left" | "right" |
One of left, right. |
eyebrow |
string |
recipes.KpiCards
Section titled “recipes.KpiCards”compose(slide, h(KpiCards, props))Two to four KPI cards with a value, label and change.
Options: Kpi.
| Option | Type | Description |
|---|---|---|
title (required) |
string |
|
kpis (required) |
Kpi[] |
|
eyebrow |
string |
|
note |
string |
recipes.Matrix2x2
Section titled “recipes.Matrix2x2”compose(slide, h(Matrix2x2, props))A 2×2 matrix with axis labels.
Options: Quadrant.
| Option | Type | Description |
|---|---|---|
title (required) |
string |
|
eyebrow |
string |
|
xLabel (required) |
string |
|
yLabel (required) |
string |
|
quadrants (required) |
[Quadrant, Quadrant, Quadrant, Quadrant] |
recipes.PricingTiers
Section titled “recipes.PricingTiers”compose(slide, h(PricingTiers, props))Pricing tiers; the highlighted tier is emphasized.
| Option | Type | Description |
|---|---|---|
title (required) |
string |
|
eyebrow |
string |
|
tiers (required) |
Array<{ name: string; price: string; period?: string; features: string[]; highlight?: boolean }> |
recipes.ProcessSteps
Section titled “recipes.ProcessSteps”compose(slide, h(ProcessSteps, props))Numbered process steps as cards.
| Option | Type | Description |
|---|---|---|
title (required) |
string |
|
eyebrow |
string |
|
steps (required) |
Array<{ title: string; text?: string }> |
recipes.ProsCons
Section titled “recipes.ProsCons”compose(slide, h(ProsCons, props))Pros and cons in two tinted panels.
| Option | Type | Description |
|---|---|---|
title (required) |
string |
|
eyebrow |
string |
|
pros (required) |
string[] |
|
cons (required) |
string[] |
recipes.Quote
Section titled “recipes.Quote”compose(slide, h(Quote, props))A customer or expert quote with attribution.
| Option | Type | Description |
|---|---|---|
quote (required) |
string |
|
author (required) |
string |
|
role |
string |
recipes.SectionDivider
Section titled “recipes.SectionDivider”compose(slide, h(SectionDivider, props))Section divider on an accent background.
| Option | Type | Description |
|---|---|---|
title (required) |
string |
|
number |
string | number |
|
subtitle |
string |
recipes.TeamGrid
Section titled “recipes.TeamGrid”compose(slide, h(TeamGrid, props))People with photos (or initials), names and roles.
| Option | Type | Description |
|---|---|---|
title (required) |
string |
|
eyebrow |
string |
|
people (required) |
Array<{ name: string; role: string; photo?: ImageOptions["source"] }> |
recipes.Timeline
Section titled “recipes.Timeline”compose(slide, h(Timeline, props))Milestones on a horizontal line.
| Option | Type | Description |
|---|---|---|
title (required) |
string |
|
eyebrow |
string |
|
steps (required) |
Array<{ date: string; title: string; text?: string }> |
recipes.TitleBullets
Section titled “recipes.TitleBullets”compose(slide, h(TitleBullets, props))Title and bullet points (with optional sub-points).
Options: Bullet.
| Option | Type | Description |
|---|---|---|
title (required) |
string |
|
bullets (required) |
Bullet[] |
|
eyebrow |
string |
recipes.TitleSlide
Section titled “recipes.TitleSlide”compose(slide, h(TitleSlide, props))Opening slide: large title, subtitle and a date, over an accent rule.
| Option | Type | Description |
|---|---|---|
title (required) |
string |
|
subtitle |
string |
|
eyebrow |
string |
|
date |
string |
|
figures |
Array<{ value: string; label: string }> |
Up to four headline figures along the bottom, for a short briefing whose cover also gives the answer: [{ value: "3.7%", label: "CPI, Sep 2026" }]. A deck still opens with this cover. |
recipes.TwoCharts
Section titled “recipes.TwoCharts”compose(slide, h(TwoCharts, props))Two charts side by side, each with its own title, and the points to take from them.
| Option | Type | Description |
|---|---|---|
title (required) |
string |
|
eyebrow |
string |
|
left (required) |
Omit<ChartProps, keyof LayoutProps | "categories"> & { categories?: ChartProps["categories"]; format?: string } |
Each chart: its title, type, categories and series, plus any chart option; format is short for axes.y.format. |
right (required) |
Omit<ChartProps, keyof LayoutProps | "categories"> & { categories?: ChartProps["categories"]; format?: string } |
|
takeaways |
string[] |
Up to three points, under the charts. |
note |
string |
recipes.TwoColumns
Section titled “recipes.TwoColumns”compose(slide, h(TwoColumns, props))Two columns of points, each with an optional heading.
Options: Bullet.
| Option | Type | Description |
|---|---|---|
title (required) |
string |
|
eyebrow |
string |
|
left (required) |
{ heading?: string; bullets: Bullet[] } |
|
right (required) |
{ heading?: string; bullets: Bullet[] } |
nodes.box
Section titled “nodes.box”h("box", props, ...children)A panel: one child with padding and visual props (fill, line, radius, shadow).
| Option | Type | Description |
|---|---|---|
fill |
string |
|
line |
string | LineOptions |
|
radius |
number | string |
|
shadow |
string |
|
geometry |
ShapeOptions["geometry"] |
|
className |
string |
|
alt |
string |
|
gap |
Gap |
|
padding |
Spacing |
|
justify |
Justify |
Along the main axis. |
align |
Align |
Across the main axis. Default “stretch”. |
name |
string |
Role name, kept on the native object (e.g. “title”, “kpi-revenue”). |
width |
Size |
|
height |
Size |
|
minWidth |
number |
|
maxWidth |
number |
|
minHeight |
number |
|
maxHeight |
number |
|
matchHeight |
string |
Nodes with the same key take the height of the tallest, so side-by-side cards line up: when one card’s label wraps to two lines, every card’s value moves down with it (e.g. “kpi-label”). |
grow |
number |
Share of the free space along the parent’s direction (flex-grow). |
shrink |
number |
|
alignSelf |
Align |
|
margin |
Spacing |
|
colSpan |
number |
Grid cells: columns this child spans. |
nodes.br
Section titled “nodes.br”h("br", props)A line break inside a paragraph.
nodes.chart
Section titled “nodes.chart”h("chart", props, ...children)A native chart laid out in the tree: type plus ChartOptions except frame, e.g. h(“chart”, { type: “line”, categories, series }).
| Option | Type | Description |
|---|---|---|
name |
string |
Role name, kept on the native object (e.g. “title”, “kpi-revenue”). |
width |
Size |
|
height |
Size |
|
minWidth |
number |
|
maxWidth |
number |
|
minHeight |
number |
|
maxHeight |
number |
|
matchHeight |
string |
Nodes with the same key take the height of the tallest, so side-by-side cards line up: when one card’s label wraps to two lines, every card’s value moves down with it (e.g. “kpi-label”). |
grow |
number |
Share of the free space along the parent’s direction (flex-grow). |
shrink |
number |
|
alignSelf |
Align |
|
margin |
Spacing |
|
colSpan |
number |
Grid cells: columns this child spans. |
type (required) |
ChartType |
|
alt |
string |
|
style |
string | TextStyle |
Default text for the chart: font, size, color. |
border |
string | LineOptions |
|
categories |
Array<string | number | string[]> |
Category labels (not used by scatter and bubble charts). Treemap and sunburst take a path per point, outermost first: [["Enterprise", "EMEA"], ["SMB"]]. Box & whisker: one per value. |
series (required) |
ChartSeriesInput[] |
|
title |
string | { text: string; style?: string | TextStyle; overlay?: boolean } |
|
legend |
false | LegendPosition | { position?: LegendPosition; overlay?: boolean; style?: string | TextStyle } |
Position, false to hide, or options. Default bottom. |
dataLabels |
boolean | DataLabelsInput |
Labels on every series. true = values. |
stacked |
boolean | "percent" |
Column, bar, line and area charts: stack series, or stack to 100%. |
axes |
{ x?: AxisInput; y?: AxisInput; y2?: AxisInput } |
y2: the secondary value axis on the right, for series with axis: “secondary”. |
gap |
number |
Space between bar groups, percent of a bar’s width (0–500). |
overlap |
number |
Bar overlap within a group, percent (-100–100). |
holeSize |
number |
Doughnut hole, percent of the diameter (10–90). |
firstSliceAngle |
number |
Pie and doughnut rotation in degrees. |
varyColors |
boolean |
A different color for every point. |
radarStyle |
"marker" | "filled" | "lines" |
One of marker, filled, lines. |
blanks |
"gap" | "zero" | "span" |
How gaps draw: leave a gap, drop to zero, or connect across. One of gap, zero, span. |
background |
string |
|
plotBackground |
string |
|
upDownBars |
boolean |
Stock charts with four series (open, high, low, close). |
highLowLines |
boolean |
|
totals |
number[] |
Waterfall: indexes of the points that are totals (full bars from zero), e.g. [0, 4]. |
connectorLines |
boolean |
Waterfall: lines joining the bars (default true). |
parentLabels |
"overlapping" | "banner" | "none" |
Treemap: parent labels (default “overlapping”). One of overlapping, banner, none. |
bins |
number | { count?: number; width?: number } |
Histogram: the number of bins, or their width (default: automatic). |
threeD |
boolean |
Column, bar, line, area and pie charts drawn in 3D. 3D distorts values: prefer 2D. |
split |
{ by: "position" | "value" | "percent" | "custom"; value?: number; points?: number[]; /** Size of the second plot, percent of the first (5–200, default 75). */ secondSize?: number } |
Pie-of-pie and bar-of-pie: which points go to the second plot. By “position” (the last value points), “value” (points below value), “percent” (below value percent of the whole) or “custom” (the points listed). Default: Office’s automatic split. |
wireframe |
boolean |
Surface and contour charts: lines only, no fill. |
boxWhisker |
{ /** A line through the means (default false). */ meanLine?: boolean; /** An x at each mean (default true). */ meanMarkers?: boolean; /** Points beyond the whiskers (default true). */ outliers?: boolean; /** Every value as a point (default false). */ innerPoints?: boolean; /** Median method (default "exclusive"). */ quartiles?: "exclusive" | "inclusive" } |
Box & whisker: what to draw besides the boxes. |
nodes.column
Section titled “nodes.column”h("column", props, ...children)Children top to bottom (a flex column): gap, padding, justify, align, wrap.
| Option | Type | Description |
|---|---|---|
wrap |
boolean |
Wrap children onto new lines when they do not fit. |
gap |
Gap |
|
padding |
Spacing |
|
justify |
Justify |
Along the main axis. |
align |
Align |
Across the main axis. Default “stretch”. |
name |
string |
Role name, kept on the native object (e.g. “title”, “kpi-revenue”). |
width |
Size |
|
height |
Size |
|
minWidth |
number |
|
maxWidth |
number |
|
minHeight |
number |
|
maxHeight |
number |
|
matchHeight |
string |
Nodes with the same key take the height of the tallest, so side-by-side cards line up: when one card’s label wraps to two lines, every card’s value moves down with it (e.g. “kpi-label”). |
grow |
number |
Share of the free space along the parent’s direction (flex-grow). |
shrink |
number |
|
alignSelf |
Align |
|
margin |
Spacing |
|
colSpan |
number |
Grid cells: columns this child spans. |
nodes.grid
Section titled “nodes.grid”h("grid", props, ...children)Children in a grid of column (and row) tracks; colSpan on a child spans columns.
| Option | Type | Description |
|---|---|---|
columns (required) |
number | Array<number | string> |
Column tracks: px, “2fr”, “auto”, or a count of equal columns. |
rows |
Array<number | string> |
Row tracks (default: auto, as tall as the tallest cell). |
gap |
Gap |
|
padding |
Spacing |
|
justify |
Justify |
Along the main axis. |
align |
Align |
Across the main axis. Default “stretch”. |
name |
string |
Role name, kept on the native object (e.g. “title”, “kpi-revenue”). |
width |
Size |
|
height |
Size |
|
minWidth |
number |
|
maxWidth |
number |
|
minHeight |
number |
|
maxHeight |
number |
|
matchHeight |
string |
Nodes with the same key take the height of the tallest, so side-by-side cards line up: when one card’s label wraps to two lines, every card’s value moves down with it (e.g. “kpi-label”). |
grow |
number |
Share of the free space along the parent’s direction (flex-grow). |
shrink |
number |
|
alignSelf |
Align |
|
margin |
Spacing |
|
colSpan |
number |
Grid cells: columns this child spans. |
nodes.image
Section titled “nodes.image”h("image", props, ...children)A picture laid out in the tree; takes ImageOptions except frame (it keeps its aspect ratio).
| Option | Type | Description |
|---|---|---|
name |
string |
Role name, kept on the native object (e.g. “title”, “kpi-revenue”). |
width |
Size |
|
height |
Size |
|
minWidth |
number |
|
maxWidth |
number |
|
minHeight |
number |
|
maxHeight |
number |
|
matchHeight |
string |
Nodes with the same key take the height of the tallest, so side-by-side cards line up: when one card’s label wraps to two lines, every card’s value moves down with it (e.g. “kpi-label”). |
grow |
number |
Share of the free space along the parent’s direction (flex-grow). |
shrink |
number |
|
alignSelf |
Align |
|
margin |
Spacing |
|
colSpan |
number |
Grid cells: columns this child spans. |
alt |
string |
Alternative text. Strongly recommended. |
line |
string | LineOptions |
|
shadow |
string |
|
radius |
number | string |
Corner radius in px or a token; clips to roundRect. |
rotation |
number |
Degrees, clockwise. |
source (required) |
ImageSource |
|
fit |
"contain" | "cover" | "fill" |
contain (default): shrink the frame to the image’s aspect ratio, centered. cover: fill the frame and crop the overflow evenly. fill: stretch to the frame. One of contain, cover, fill. |
crop |
{ left?: number; top?: number; right?: number; bottom?: number } |
Extra crop applied first, as fractions (0.1 = 10%) of the source image. |
clip |
PresetGeometry |
Clip the picture to a preset shape, e.g. “ellipse”. |
nodes.paragraph
Section titled “nodes.paragraph”h("paragraph", props, ...children)A paragraph inside <text>: bullets, level, spacing and alignment.
| Option | Type | Description |
|---|---|---|
style |
string | TextStyle |
|
className |
string |
|
bullet |
boolean | string |
true for “•”, a character, “number”, or false. |
level |
number |
0–8 |
align |
TextStyle["align"] |
|
spaceBefore |
number |
|
spaceAfter |
number |
|
lineHeight |
number | string |
|
name |
string |
Role name, kept on the native object (e.g. “title”, “kpi-revenue”). |
width |
Size |
|
height |
Size |
|
minWidth |
number |
|
maxWidth |
number |
|
minHeight |
number |
|
maxHeight |
number |
|
matchHeight |
string |
Nodes with the same key take the height of the tallest, so side-by-side cards line up: when one card’s label wraps to two lines, every card’s value moves down with it (e.g. “kpi-label”). |
grow |
number |
Share of the free space along the parent’s direction (flex-grow). |
shrink |
number |
|
alignSelf |
Align |
|
margin |
Spacing |
|
colSpan |
number |
Grid cells: columns this child spans. |
nodes.row
Section titled “nodes.row”h("row", props, ...children)Children left to right (a flex row): gap, padding, justify, align, wrap.
| Option | Type | Description |
|---|---|---|
wrap |
boolean |
Wrap children onto new lines when they do not fit. |
gap |
Gap |
|
padding |
Spacing |
|
justify |
Justify |
Along the main axis. |
align |
Align |
Across the main axis. Default “stretch”. |
name |
string |
Role name, kept on the native object (e.g. “title”, “kpi-revenue”). |
width |
Size |
|
height |
Size |
|
minWidth |
number |
|
maxWidth |
number |
|
minHeight |
number |
|
maxHeight |
number |
|
matchHeight |
string |
Nodes with the same key take the height of the tallest, so side-by-side cards line up: when one card’s label wraps to two lines, every card’s value moves down with it (e.g. “kpi-label”). |
grow |
number |
Share of the free space along the parent’s direction (flex-grow). |
shrink |
number |
|
alignSelf |
Align |
|
margin |
Spacing |
|
colSpan |
number |
Grid cells: columns this child spans. |
nodes.rule
Section titled “nodes.rule”h("rule", props, ...children)A line along the parent’s cross axis: horizontal in a column, vertical in a row.
| Option | Type | Description |
|---|---|---|
line |
string | LineOptions |
|
name |
string |
Role name, kept on the native object (e.g. “title”, “kpi-revenue”). |
width |
Size |
|
height |
Size |
|
minWidth |
number |
|
maxWidth |
number |
|
minHeight |
number |
|
maxHeight |
number |
|
matchHeight |
string |
Nodes with the same key take the height of the tallest, so side-by-side cards line up: when one card’s label wraps to two lines, every card’s value moves down with it (e.g. “kpi-label”). |
grow |
number |
Share of the free space along the parent’s direction (flex-grow). |
shrink |
number |
|
alignSelf |
Align |
|
margin |
Spacing |
|
colSpan |
number |
Grid cells: columns this child spans. |
nodes.run
Section titled “nodes.run”h("run", props, ...children)A run of text inside a paragraph with its own style (bold, color, link).
| Option | Type | Description |
|---|---|---|
style |
string | TextStyle |
|
bold |
boolean |
|
italic |
boolean |
|
underline |
boolean |
|
color |
string |
|
link |
string |
nodes.shape
Section titled “nodes.shape”h("shape", props, ...children)A native shape (any preset geometry) laid out like a box; takes ShapeOptions except frame.
| Option | Type | Description |
|---|---|---|
name |
string |
Role name, kept on the native object (e.g. “title”, “kpi-revenue”). |
width |
Size |
|
height |
Size |
|
minWidth |
number |
|
maxWidth |
number |
|
minHeight |
number |
|
maxHeight |
number |
|
matchHeight |
string |
Nodes with the same key take the height of the tallest, so side-by-side cards line up: when one card’s label wraps to two lines, every card’s value moves down with it (e.g. “kpi-label”). |
grow |
number |
Share of the free space along the parent’s direction (flex-grow). |
shrink |
number |
|
alignSelf |
Align |
|
margin |
Spacing |
|
colSpan |
number |
Grid cells: columns this child spans. |
geometry |
Geometry |
Any ECMA-376 preset (rect, roundRect, ellipse, rightArrow, star5, …), “textbox” or “custom”. Default “rect”. |
alt |
string |
Alternative text for screen readers. |
fill |
string |
Color, gradient (“linear(135deg, white, sky-100)”), pattern or “none”. |
line |
string | LineOptions |
Stroke string (“2px dashed slate-300”) or options. |
shadow |
string |
Shadow token (shadow-sm … shadow-2xl) or “x y blur color”. |
radius |
number | string |
Corner radius in px or a token (rounded-xl). Turns rect into roundRect. |
adjust |
Record<string, number> |
Raw preset adjust values, e.g. { adj: 16667 } (1/100000 of the shorter side). |
rotation |
number |
Degrees, clockwise. |
flipH |
boolean |
|
flipV |
boolean |
|
className |
string |
Tailwind-style visual classes; explicit options win. |
textStyle |
string | TextStyle |
Default style for every run: style string or object. |
textBox |
TextBoxOptions |
|
paths |
CustomPath[] |
Required when geometry is “custom”. |
nodes.spacer
Section titled “nodes.spacer”h("spacer", props, ...children)Empty space; grows by default.
| Option | Type | Description |
|---|---|---|
name |
string |
Role name, kept on the native object (e.g. “title”, “kpi-revenue”). |
width |
Size |
|
height |
Size |
|
minWidth |
number |
|
maxWidth |
number |
|
minHeight |
number |
|
maxHeight |
number |
|
matchHeight |
string |
Nodes with the same key take the height of the tallest, so side-by-side cards line up: when one card’s label wraps to two lines, every card’s value moves down with it (e.g. “kpi-label”). |
grow |
number |
Share of the free space along the parent’s direction (flex-grow). |
shrink |
number |
|
alignSelf |
Align |
|
margin |
Spacing |
|
colSpan |
number |
Grid cells: columns this child spans. |
nodes.span
Section titled “nodes.span”h("span", props, ...children)Same as <run>.
| Option | Type | Description |
|---|---|---|
style |
string | TextStyle |
|
bold |
boolean |
|
italic |
boolean |
|
underline |
boolean |
|
color |
string |
|
link |
string |
nodes.stack
Section titled “nodes.stack”h("stack", props, ...children)Layers on top of each other: the first child sets the size, later ones cover it.
| Option | Type | Description |
|---|---|---|
gap |
Gap |
|
padding |
Spacing |
|
justify |
Justify |
Along the main axis. |
align |
Align |
Across the main axis. Default “stretch”. |
name |
string |
Role name, kept on the native object (e.g. “title”, “kpi-revenue”). |
width |
Size |
|
height |
Size |
|
minWidth |
number |
|
maxWidth |
number |
|
minHeight |
number |
|
maxHeight |
number |
|
matchHeight |
string |
Nodes with the same key take the height of the tallest, so side-by-side cards line up: when one card’s label wraps to two lines, every card’s value moves down with it (e.g. “kpi-label”). |
grow |
number |
Share of the free space along the parent’s direction (flex-grow). |
shrink |
number |
|
alignSelf |
Align |
|
margin |
Spacing |
|
colSpan |
number |
Grid cells: columns this child spans. |
nodes.table
Section titled “nodes.table”h("table", props, ...children)A native table laid out in the tree; takes TableOptions except frame.
| Option | Type | Description |
|---|---|---|
name |
string |
Role name, kept on the native object (e.g. “title”, “kpi-revenue”). |
width |
Size |
|
height |
Size |
|
minWidth |
number |
|
maxWidth |
number |
|
minHeight |
number |
|
maxHeight |
number |
|
matchHeight |
string |
Nodes with the same key take the height of the tallest, so side-by-side cards line up: when one card’s label wraps to two lines, every card’s value moves down with it (e.g. “kpi-label”). |
grow |
number |
Share of the free space along the parent’s direction (flex-grow). |
shrink |
number |
|
alignSelf |
Align |
|
margin |
Spacing |
|
colSpan |
number |
Grid cells: columns this child spans. |
alt |
string |
|
textStyle |
string | TextStyle |
Style for body cells. |
rows (required) |
Cell[][] |
Rows of cells, HTML-style: a cell with colSpan/rowSpan covers later positions, and the covered positions are left out of later cells in that row or the rows below. |
columns |
Array<number | string> |
Column widths in px or fractions (“2fr”). Default: by content, so short columns stay narrow and long text gets the room (no column narrower than its longest word, where the width allows). |
header |
boolean | number |
Number of header rows (default 1). false = 0. |
style |
TableStylePreset |
Default “grid”. |
headerFill |
string |
|
headerColor |
string |
|
bandFill |
string |
Fill for alternating body rows. |
border |
string |
Border stroke used by the preset, e.g. “1px solid slate-300”. |
headerStyle |
string | TextStyle |
Style for header cells (merged over textStyle). |
padding |
number | { x: number; y: number } |
Cell padding in px: one value or { x, y }. Default { x: 12, y: 8 }. |
rowHeight |
number |
Minimum row height in px. Default: frame height divided by the row count. |
rowHeights |
number[] |
Each row’s height in px, overriding rowHeight (compose sets these from the measured text). |
numberAlign |
TextStyle["align"] |
Alignment for columns whose body cells are all numbers, header included. Default “right”. |
nodes.text
Section titled “nodes.text”h("text", props, ...children)A native text box sized to its text: plain children, <paragraph> and <run>, styled with className or style.
| Option | Type | Description |
|---|---|---|
style |
string | TextStyle |
|
className |
string |
|
align |
TextStyle["align"] |
Horizontal alignment of every paragraph. |
valign |
TextBoxOptions["valign"] |
|
textBox |
TextBoxOptions |
|
fill |
string |
Background of the text box (a fill color or gradient). |
line |
string | LineOptions |
|
radius |
number | string |
|
name |
string |
Role name, kept on the native object (e.g. “title”, “kpi-revenue”). |
width |
Size |
|
height |
Size |
|
minWidth |
number |
|
maxWidth |
number |
|
minHeight |
number |
|
maxHeight |
number |
|
matchHeight |
string |
Nodes with the same key take the height of the tallest, so side-by-side cards line up: when one card’s label wraps to two lines, every card’s value moves down with it (e.g. “kpi-label”). |
grow |
number |
Share of the free space along the parent’s direction (flex-grow). |
shrink |
number |
|
alignSelf |
Align |
|
margin |
Spacing |
|
colSpan |
number |
Grid cells: columns this child spans. |