Skip to main content
Text is the most common layer type in any presentation. The Decks SDK gives you three dedicated layer types — plain text, bullet lists, and numbered lists — each with a full set of typography options and two authoring styles: an inline object you embed directly in a layer array, or a builder function that produces the same result. Both produce an identical output and are interchangeable; choose whichever reads more clearly in your code. All three types share the same base typography options from TextOptions. You can set the semantic style preset (which resolves to theme CSS variables at render time), override individual properties like fontSize, color, and fontFamily, and control paragraph spacing and alignment. Builder functions validate all options through Zod at call time, so you’ll get a clear runtime error before anything is sent to the API.

Text

A text layer renders one or more lines of styled prose. Pass a single string for a one-liner, or an array of strings to stack multiple paragraphs with consistent styling.

Inline syntax

Builder function syntax

Multi-line text

Pass an array of strings to render multiple paragraphs — each string becomes its own line, all sharing the same style options.

TextStyle presets

The style option maps to one of eight theme-aware presets. Render-time CSS variables resolve these to the appropriate font size, weight, and line-height for the active deck theme — so your text automatically matches the presentation’s visual language.

title

Largest display text — slide titles, hero headers

h1

Primary section heading

h2

Secondary heading or subtitle

h3

Tertiary heading, callout labels

body1

Standard body copy

body2

Smaller body text, secondary prose

note

Footnotes, caveats, source lines

caption

Image captions, chart sub-labels

TextOptions reference

'title' | 'h1' | 'h2' | 'h3' | 'body1' | 'body2' | 'note' | 'caption'
Theme text style preset. Resolves to CSS variable-backed typography at render time. Override individual fields (fontSize, fontWeight, etc.) to customize beyond the preset.
string
Font size as a CSS string, e.g. '24px' or '1.5rem'. Overrides the style preset’s default size.
string
Text color as a CSS color string, e.g. '#1a1a2e', 'rgba(0,0,0,0.8)', or 'var(--slide-brand)'.
string
Font family — must be one of the families available in the deck theme (fontFamilySchema).
number | string
Font weight on the 100–900 axis, e.g. 400, 600, or 'bold'.
string
Line height multiplier or absolute value, e.g. '1.5' or '28px'.
string
Letter spacing (tracking), e.g. '0.02em' or '1px'.
string
Inline text highlight color — paints a background behind the text itself (not the layer box).
string
Paragraph spacing above, e.g. '12px'.
string
Paragraph spacing below, e.g. '8px'.
boolean
Shorthand for fontWeight: 700. If fontWeight is also set, fontWeight wins.
boolean
Render text in italic style.
'left' | 'center' | 'right' | 'justify'
Horizontal text alignment within the layer box.

Full example


Bullets

A bullets layer renders an unordered list. Pass an array of strings — each string becomes one bullet item. Bullet options extend all of TextOptions, so you can style both the marker and the item text in one call.

Inline syntax

Builder function syntax

Bullet-specific options

These options are available in addition to all TextOptions fields.
'disc' | 'circle' | 'square'
Standard CSS bullet marker shape. Use bulletStyle for custom icon keys.
string
Custom bullet icon key, e.g. 'circle-filled', 'arrow-right', 'check'. Overrides listStyleType when set.
string
Color applied to the bullet marker only — independent of the item text color.
number
Bullet marker size in pixels.
number
Stroke width for outlined bullet markers.
number
Vertical spacing in pixels between list items.
number
Horizontal gap in pixels between the bullet marker and the item text.
'center' | 'top'
Vertical alignment of the bullet marker relative to the first line of item text.

Example with custom markers

Use bulletColor to match your brand palette while keeping item text in a neutral dark color. This creates visual hierarchy between the marker and the content without changing the text style.

Numbered

A numbered layer renders an ordered list. Like bullets, pass an array of strings and style both the number marker and the text. The listStyle option controls the numbering scheme — decimal, alphabetic, or Roman numerals.

Inline syntax

Builder function syntax

Numbered-specific options

'decimal' | 'lower-alpha' | 'upper-alpha' | 'lower-roman' | 'upper-roman'
Numbering scheme for the markers. Defaults to 'decimal' (1, 2, 3…).
string
Color applied to the number marker only.
number
Font size for the number marker in pixels.
string
Font family for the number marker — lets you use a display font for numbers while keeping body text in the theme font.
string
Font weight for the number marker.
number
Vertical spacing in pixels between list items.
number
Horizontal gap in pixels between the number marker and the item text.
'center' | 'top'
Vertical alignment of the number marker relative to the first line of item text.

Example with Roman numerals

The listStyle option mirrors the CSS list-style-type property vocabulary. Use 'lower-alpha' for (a, b, c…), 'upper-alpha' for (A, B, C…), 'lower-roman' for (i, ii, iii…), and 'upper-roman' for (I, II, III…).

Choosing between inline and builder syntax

You are composing a layer array for a slide definition and want all layer data in one place. The inline object is just a plain TypeScript object literal — no imports beyond Decks itself.