Skip to content

Attributes

View Markdownllms.txt

Attributes go in braces, as in {size=5xl color=accent}. This page lists every attribute the compiler accepts and the valid values for each one. For the brace syntax itself (.style, #id, quotes, position on the line), see Syntax.

An unknown attribute is an error (R209), and so is an invalid value (R301); the messages suggest the closest name or value.

They work on any block, on the page separator (--- {…}), on text spans ([text]{…}) and on images.

AttributeAccepted valuesExampleNotes
colorColorcolor=accentText color. Also applies to icons.
bgColor or gradient color..colorbg=ink..violetBackground. The gradient is linear and diagonal (135°).
imagehttps://…, http://…, data:image/… or asset:<id>image=asset:<id>Background image, covering the area and centered.
fontFont token: body, display, mono or a @fontfont=displayTypeface.
sizeSize scale or pixels from 8 to 400size=5xl, size=120Text size; on icons, the icon size.
weightWeight by name or 100 to 900, in steps of 100weight=bold, weight=600Font weight.
italicBooleanitalic, italic=falseItalic.
uppercaseBooleanuppercaseAll caps.
alignleft, center, rightalign=centerHorizontal alignment, in any layout.
valigntop, center (or middle), bottomvalign=bottomVertical alignment, in any layout.
padOne or two spacing valuespad=lg, pad="sm xl"Inner spacing. With two values: vertical and horizontal.
gapSpacinggap=xlSpace between the children of a block.
radiusRadius or pixels from 0 to 9999radius=lgRounded corners.
borderWidth (0 to 40 px) and/or color, in any orderborder, border="2 coral"With no value: 3 px in the theme’s line color.
shadowsm, md, lg, noneshadow, shadow=lgWith no value, it is md.
wLength or autow=50%, w=480Width.
hLength or autoh=fullHeight.
xLengthx=120Absolute horizontal position (distance from the page’s left edge).
yLengthy=80Absolute vertical position (distance from the page’s top edge). With only one of x/y, the other is 0.
opacityNumber from 0 to 1 or percentage from 0% to 100%opacity=0.6, opacity=60%Transparency of the whole block.
leadingtight, normal, loose or a number from 0.6 to 3leading=tightLine height. See line height.
trackingtight, normal, wide or a number from -0.2 to 1 (in em)tracking=0.1Letter spacing.
stepWhole number from 1 to 99step=2Step at which the block or span appears. See Reveal.
enterfade, up, down, left, right, zoom, noneenter=zoomHow the element appears on a step or when an if becomes true. Steps default to up.
ifConditionif=$details, if="$n > 2"Shows the element only when the condition is true. See Variables.
clickActions separated by ;click="go #end"What happens on click. See Interactivity.
keyA letter, a digit, up, down, left, right, Enter or Spacekey=upKey that runs the element’s click. See Keyboard.

In addition, .style=condition applies a style only when the condition is true: {.highlight="$plan == pro"}. With .style=hover, the style applies while the mouse is over the element.

Attribute values accept $variable and $( expression ), as long as they don’t depend on @state (R604).

Boolean attributes accept true, yes or sim to turn on and false, no or não to turn off. Writing just the name ({italic}) turns the attribute on.

--- {bg=paper..surface}
::: columns {gap=xl}
::: box {bg=accent color=white radius=xl pad="md lg" shadow=lg}
## Warm card
`accent` background, `xl` corners
:::
::: box {border="4 blue" radius=md pad=lg}
## Blue border {color=blue}
`border="4 blue"` {italic}
:::
::: box {bg=ink..violet color=white radius=full pad="lg xl" align=center}
## Gradient
`bg=ink..violet` {opacity=0.8}
:::
:::

Besides the style attributes, some blocks accept attributes of their own. Using them anywhere else is an error (R209). In a @style, all of them are accepted, and they only take effect when the style is applied to the right block.

AttributeWhereValuesDefaultExample
fitBlock imagecontain (whole image) or cover (fills and crops)contain![Photo](https://…){fit=cover}
widthscolumnsPositive numbers separated by spaces, one per columnEqual columns::: columns {widths="2 1"}
colsgridWhole number from 1 to 12Number of children, from 1 to 3::: grid {cols=4}
wraprowBoolean: wraps the items onto more than one lineOff::: row {wrap}
typechartbar, line, area, pie, donutbar::: chart {type=line}
legendchartBooleanOn with more than one series or for pie/donut{legend=false}
stackedchartBoolean: stacks the seriesOff{stacked}
valueschartBoolean: shows the values on the chartOff{values}
colorschartList of colors separated by spaces, one per seriesTheme palette{colors="accent blue"}
datachart, tableA list of records (@data):: chart {data=$sales}
labelchart with dataThe field with the labelsThe first text field{label=month}
serieschart with dataFields with the values, separated by spacesEvery numeric field{series="revenue cost"}
columnstableFields shown, in orderAll{columns="name role"}
cover--- separatorBoolean: the page is a cover and has no header, footer or overlayOn for the first page only--- {cover}
header--- separatoron or off: shows or hides the header on this pageOn, except on the cover--- {header=off}
footer--- separatoron or off: shows or hides the footer on this pageOn, except on the cover--- {footer=on}
overlay--- separatoron or off: shows or hides the overlay on this pageOn, except on the cover--- {overlay=off}
hidden--- separatorBoolean: the page leaves the normal flow and is only reached by link or goOff--- {#extra hidden}
next--- separatorId of the following page when advancingThe next page--- {next=#end}
steps--- separatorMinimum number of steps in the page, from 1 to 99Computed--- {steps=3}
transition--- separatorfade, slide, zoom, none@transition or none--- {transition=slide}
timeout--- separatorSeconds (1 to 3600) until on-timeout runsNone--- {timeout=30}
on-timeout--- separatorActions when timeout is reached, go includedNone--- {timeout=30 on-timeout="go #end"}
nav--- separatoron or off: with off, arrows, space, click and swipe do not leave the pageon (off with @mode game)--- {nav=off}
on-enter--- separatorState actions separated by ; ($x = value, toggle $x)None--- {on-enter="$seen = true"}
width--- separatorPage width in pixels, from 16 to 16384@page or the host’s default--- {width=1080}
height--- separatorPage height in pixels, from 16 to 16384, or auto (grows with the content)@page or the host’s default--- {width=1080 height=1920}

In widths, the proportions are relative: "2 1" gives two parts to the first column and one to the second. If the number of values does not match the number of columns, the compiler warns (R302).

The default chart palette uses, in order, accent, blue, green, yellow, violet and coral.

Used by size. Pixels from 8 to 400 also work.

NamePixels
xs20
sm26
md32
lg40
xl52
2xl64
3xl88
4xl116
5xl150
6xl200
7xl260
::: row {gap=lg valign=bottom}
md {size=md}
xl {size=xl}
3xl {size=3xl}
5xl {size=5xl}
7xl {size=7xl}
:::

Used by pad, gap and :: spacer. Pixels from 0 to 600 also work.

NamePixels
none0
xs8
sm16
md32
lg48
xl72
2xl112
3xl160

Used by radius. Pixels from 0 to 9999 also work.

NamePixels
none0
sm8
md16
lg28
xl44
full9999 (pill or circle shape)

Used by weight. Numbers from 100 to 900, in steps of 100, also work.

NameWeight
thin100
light300
regular400
medium500
semibold600
bold700
extrabold800
black900

A weight only shows up if the font has it. Fonts declared with @font load the weights listed in the definition.

AttributeKeywordValueNumeric range
leadingtight1.050.6 to 3 (multiplies the font size)
leadingnormal1.35
leadingloose1.7
trackingtight-0.02 em-0.2 to 1 (in em)
trackingnormal0
trackingwide0.08 em

Used by w, h, x and y.

FormExampleMeaning
Pixels480 or 480pxFrom -4000 to 4000. The px suffix is optional.
Percentage50%From 0% to 100% of the available space.
fullw=fullSame as 100%.
autoh=autoAutomatic size. Only for w and h.

Lengths are pixels of the page, whatever the screen it is shown on. The page size comes from the program that shows the document (a presentation app usually uses 1920×1080), from @page (@page 1440x1080) or from width and height on the separator; without any of them, the page is 1920 wide with automatic height. With automatic height, the page grows with the content. See Page sizes.

Used by color, bg, border and colors.

FormExampleMeaning
Theme tokenaccent, muted, coralColor defined by the theme or by @color.
Hexadecimal#f60, #ff6600, #ff660080#rgb, #rgba, #rrggbb or #rrggbbaa.
Opacityaccent/40, #000000/20Color with an opacity from 0 to 100 (%), after the slash.
Gradientink..violet, accent/80..blueTwo colors separated by ... Only in bg.

Tokens available in every theme: bg, text, muted, accent, surface, line, coral, blue, green, yellow, violet, white, black, ink, paper and transparent. The values for each theme are in Built-in themes.

Every color token also works as a style: {.coral} is the same as {color=coral}.

::: grid {cols=4 gap=md}
::: box {bg=accent pad=md radius=md}
`accent`
:::
::: box {bg=accent/40 pad=md radius=md}
`accent/40`
:::
::: box {bg=#2f6fdb color=white pad=md radius=md}
`#2f6fdb`
:::
::: box {bg=coral..violet color=white pad=md radius=md}
`coral..violet`
:::
:::