places
Map
Interactive map visualization from Markdown lists of locations
Install
- Add the package:
npm install @refrakt-md/places - Add it to the
pluginsarray inrefrakt.config.json:"plugins": ["@refrakt-md/places"]
Source
import Markdoc from '@markdoc/markdoc';
import type { Node } from '@markdoc/markdoc';
const { Ast, Tag } = Markdoc;
import {
createComponentRenderable,
createContentModelSchema,
renderNodes,
extractText,
groupByHeading,
fieldMetas,
} from '@refrakt-md/runes';
const variantType = ['street', 'satellite', 'terrain', 'dark', 'minimal'] as const;
const heightType = ['small', 'medium', 'large', 'full'] as const;
const providerType = ['openstreetmap', 'mapbox'] as const;
const COORD_PATTERN = /(-?\d+\.?\d*)\s*,\s*(-?\d+\.?\d*)/;
const SEPARATOR = /\s*[-–—]\s*/;
function parseLocationItem(node: Node): {
name: string;
description: string;
lat: string;
lng: string;
address: string;
url: string;
} {
let name = '';
let description = '';
let url = '';
const allNodes = Array.from(node.walk());
for (const child of allNodes) {
if (child.type === 'strong') {
name = Array.from(child.walk())
.filter((n) => n.type === 'text')
.map((n) => n.attributes.content)
.join('');
} else if (child.type === 'em' && child !== node) {
const emText = Array.from(child.walk())
.filter((n) => n.type === 'text')
.map((n) => n.attributes.content)
.join('');
if (!description) description = emText;
} else if (child.type === 'link') {
url = child.attributes.href || '';
}
}
const fullText = extractText(node);
let remaining = fullText;
if (name) remaining = remaining.replace(name, '');
if (description) remaining = remaining.replace(description, '');
// Read the coordinates before stripping separators, so a negative sign survives.
let lat = '';
let lng = '';
const coordMatch = remaining.match(COORD_PATTERN);
if (coordMatch) {
lat = coordMatch[1];
lng = coordMatch[2];
remaining = remaining.replace(COORD_PATTERN, '').trim();
}
remaining = remaining.replace(new RegExp(SEPARATOR.source, 'g'), ' ').trim();
const address = remaining.replace(/\s+/g, ' ').trim();
if (!name && !lat && !lng) {
name = address || fullText.trim();
} else if (!name) {
name = address || `${lat}, ${lng}`;
}
return { name, description, lat, lng, address, url };
}
const mapPin = createContentModelSchema({
attributes: {
name: { type: String, required: false },
description: { type: String, required: false },
lat: { type: String, required: false },
lng: { type: String, required: false },
address: { type: String, required: false },
url: { type: String, required: false },
group: { type: String, required: false },
},
contentModel: {
type: 'sequence',
fields: [],
},
transform(resolved, attrs, config) {
const nameTag = new Tag('span', {}, [attrs.name ?? '']);
const descriptionTag = new Tag('span', {}, [attrs.description ?? '']);
return createComponentRenderable({
rune: 'map-pin',
tag: 'li',
properties: fieldMetas(attrs, config, {
lat: '',
lng: '',
address: '',
url: '',
group: '',
}),
refs: {
name: nameTag,
description: descriptionTag,
},
children: [nameTag, descriptionTag],
});
},
});
function convertMapChildren(nodes: unknown[]): unknown[] {
const converted: Node[] = [];
groupByHeading(nodes as Node[], {
initial: '',
heading: (heading) => extractText(heading),
item(item, group) {
const loc = parseLocationItem(item);
converted.push(
new Ast.Node(
'tag',
{
name: loc.name,
description: loc.description,
lat: loc.lat,
lng: loc.lng,
address: loc.address,
url: loc.url,
group,
},
[],
'map-pin',
),
);
},
other: (node) => converted.push(node),
});
return converted;
}
export { mapPin };
export const map = createContentModelSchema({
attributes: {
zoom: {
type: String,
required: false,
description: 'Initial zoom level of the map (higher values zoom in closer).',
},
center: {
type: String,
required: false,
description: 'Coordinates to center the map on (e.g. "48.8566, 2.3522").',
},
variant: {
type: String,
required: false,
matches: variantType.slice(),
description: 'Visual style of the map tiles: street, satellite, terrain, dark, or minimal.',
},
height: {
type: String,
required: false,
matches: heightType.slice(),
description: 'Vertical size of the map container: small, medium, large, or full.',
},
provider: {
type: String,
required: false,
matches: providerType.slice(),
description: 'Tile provider used for rendering: openstreetmap or mapbox.',
},
interactive: {
type: Boolean,
required: false,
description: 'Enable or disable pan and zoom interaction on the map.',
},
route: {
type: Boolean,
required: false,
description: 'Enable or disable drawing a route line between pins.',
},
cluster: {
type: Boolean,
required: false,
description: 'Enable or disable grouping nearby pins into clusters at low zoom.',
},
},
contentModel: {
type: 'custom',
processChildren: convertMapChildren,
description:
'Parses list items into map-pin tags with bold names, italic descriptions, ' +
'link URLs, coordinate regex extraction, and heading-based grouping.',
},
transform(resolved, attrs, config) {
const body = renderNodes(resolved.children, config);
const zoomMeta = new Tag('meta', { content: attrs.zoom ?? '' });
const centerMeta = new Tag('meta', { content: attrs.center ?? '' });
const variantMeta = new Tag('meta', { content: attrs.variant ?? 'street' });
const heightMeta = new Tag('meta', { content: attrs.height ?? 'medium' });
const providerMeta = new Tag('meta', { content: attrs.provider ?? 'openstreetmap' });
const interactiveMeta = new Tag('meta', { content: String(attrs.interactive ?? true) });
const routeMeta = new Tag('meta', { content: String(attrs.route ?? false) });
const clusterMeta = new Tag('meta', { content: String(attrs.cluster ?? false) });
const pins = body.tag('li').typeof('MapPin');
const pinsList = new Tag('ol', {}, pins.toArray());
const node = createComponentRenderable({
rune: 'map',
tag: 'div',
properties: {
zoom: zoomMeta,
center: centerMeta,
variant: variantMeta,
height: heightMeta,
provider: providerMeta,
interactive: interactiveMeta,
route: routeMeta,
cluster: clusterMeta,
pin: pins,
},
refs: { pins: pinsList },
children: [pinsList],
});
node.name = 'rf-map';
return node;
},
});
Transform lists of locations into interactive maps. Supports named pins with coordinates or addresses, route lines, and grouped layers.
Simple pins
List items with coordinates become map pins. Bold text sets the pin name, italic text adds a description.
{% map zoom="13" center="48.8566, 2.3522" %}
- **Louvre Museum** - *World's largest art museum* - 48.8606, 2.3376
- **Eiffel Tower** - *Iconic iron lattice tower* - 48.8584, 2.2945
- **Notre-Dame** - *Medieval Catholic cathedral* - 48.8530, 2.3499
{% /map %}<rf-map data-rune="map" data-rune-fields="{"zoom":"13","center":"48.8566, 2.3522","variant":"street","height":"medium","provider":"openstreetmap","interactive":"true","route":"false","cluster":"false"}">
<ol data-name="pins">
<li data-rune="map-pin" data-rune-fields="{"lat":"48.8606","lng":"2.3376","address":"","url":"","group":""}" data-field="pin">
<span data-name="name">Louvre Museum</span>
<span data-name="description">World's largest art museum</span>
</li>
<li data-rune="map-pin" data-rune-fields="{"lat":"48.8584","lng":"2.2945","address":"","url":"","group":""}" data-field="pin">
<span data-name="name">Eiffel Tower</span>
<span data-name="description">Iconic iron lattice tower</span>
</li>
<li data-rune="map-pin" data-rune-fields="{"lat":"48.8530","lng":"2.3499","address":"","url":"","group":""}" data-field="pin">
<span data-name="name">Notre-Dame</span>
<span data-name="description">Medieval Catholic cathedral</span>
</li>
</ol>
</rf-map>- Louvre MuseumWorld's largest art museum
- Eiffel TowerIconic iron lattice tower
- Notre-DameMedieval Catholic cathedral
<rf-map class="rf-map rf-map--street rf-map--medium" data-variant="street" data-height="medium" data-zoom="13" data-center="48.8566, 2.3522" data-provider="openstreetmap" data-interactive="true" data-route="false" data-cluster="false" data-elevation="flush" data-rune="map" data-density="compact">
<div data-name="container" class="rf-map__container">
<ol data-name="pins" class="rf-map__pins">
<li class="rf-map-pin" data-field="pin" data-lat="48.8606" data-lng="2.3376" data-address="" data-url="" data-group="" data-rune="map-pin" data-density="full">
<span data-name="name" class="rf-map-pin__name">Louvre Museum</span>
<span data-name="description" class="rf-map-pin__description">World's largest art museum</span>
</li>
<li class="rf-map-pin" data-field="pin" data-lat="48.8584" data-lng="2.2945" data-address="" data-url="" data-group="" data-rune="map-pin" data-density="full">
<span data-name="name" class="rf-map-pin__name">Eiffel Tower</span>
<span data-name="description" class="rf-map-pin__description">Iconic iron lattice tower</span>
</li>
<li class="rf-map-pin" data-field="pin" data-lat="48.8530" data-lng="2.3499" data-address="" data-url="" data-group="" data-rune="map-pin" data-density="full">
<span data-name="name" class="rf-map-pin__name">Notre-Dame</span>
<span data-name="description" class="rf-map-pin__description">Medieval Catholic cathedral</span>
</li>
</ol>
</div>
</rf-map>How Markdown is read
| You write | It becomes |
|---|---|
| A list item | A pin |
| Bold text in the item | The pin's name |
| Italic text in the item | The pin's description, shown in its popup |
Coordinates such as 48.8606, 2.3376 | The pin's position |
| An address instead of coordinates | A pin placed by looking the address up |
| A heading | A group of pins, shown as a layer the reader can toggle |
Route
Ordered lists with route=true draw a connecting line between pins.
{% map route=true variant="terrain" %}
- **Portland** - 45.5152, -122.6784
- **Crater Lake** - 42.8684, -122.1685
- **Redwood National Park** - 41.2132, -124.0046
- **San Francisco** - 37.7749, -122.4194
{% /map %}<rf-map data-rune="map" data-rune-fields="{"zoom":"","center":"","variant":"terrain","height":"medium","provider":"openstreetmap","interactive":"true","route":"true","cluster":"false"}">
<ol data-name="pins">
<li data-rune="map-pin" data-rune-fields="{"lat":"45.5152","lng":"-122.6784","address":"","url":"","group":""}" data-field="pin">
<span data-name="name">Portland</span>
<span data-name="description"></span>
</li>
<li data-rune="map-pin" data-rune-fields="{"lat":"42.8684","lng":"-122.1685","address":"","url":"","group":""}" data-field="pin">
<span data-name="name">Crater Lake</span>
<span data-name="description"></span>
</li>
<li data-rune="map-pin" data-rune-fields="{"lat":"41.2132","lng":"-124.0046","address":"","url":"","group":""}" data-field="pin">
<span data-name="name">Redwood National Park</span>
<span data-name="description"></span>
</li>
<li data-rune="map-pin" data-rune-fields="{"lat":"37.7749","lng":"-122.4194","address":"","url":"","group":""}" data-field="pin">
<span data-name="name">San Francisco</span>
<span data-name="description"></span>
</li>
</ol>
</rf-map>- Portland
- Crater Lake
- Redwood National Park
- San Francisco
<rf-map class="rf-map rf-map--terrain rf-map--medium" data-variant="terrain" data-height="medium" data-zoom="" data-center="" data-provider="openstreetmap" data-interactive="true" data-route="true" data-cluster="false" data-elevation="flush" data-rune="map" data-density="compact">
<div data-name="container" class="rf-map__container">
<ol data-name="pins" class="rf-map__pins">
<li class="rf-map-pin" data-field="pin" data-lat="45.5152" data-lng="-122.6784" data-address="" data-url="" data-group="" data-rune="map-pin" data-density="full">
<span data-name="name" class="rf-map-pin__name">Portland</span>
<span data-name="description" class="rf-map-pin__description"></span>
</li>
<li class="rf-map-pin" data-field="pin" data-lat="42.8684" data-lng="-122.1685" data-address="" data-url="" data-group="" data-rune="map-pin" data-density="full">
<span data-name="name" class="rf-map-pin__name">Crater Lake</span>
<span data-name="description" class="rf-map-pin__description"></span>
</li>
<li class="rf-map-pin" data-field="pin" data-lat="41.2132" data-lng="-124.0046" data-address="" data-url="" data-group="" data-rune="map-pin" data-density="full">
<span data-name="name" class="rf-map-pin__name">Redwood National Park</span>
<span data-name="description" class="rf-map-pin__description"></span>
</li>
<li class="rf-map-pin" data-field="pin" data-lat="37.7749" data-lng="-122.4194" data-address="" data-url="" data-group="" data-rune="map-pin" data-density="full">
<span data-name="name" class="rf-map-pin__name">San Francisco</span>
<span data-name="description" class="rf-map-pin__description"></span>
</li>
</ol>
</div>
</rf-map>Grouped layers
Headings create pin groups that can be toggled as map layers.
{% map zoom="12" center="51.5074, -0.1278" %}
## Restaurants
- **Dishoom** - 51.5114, -0.1263
- **Bao** - 51.5133, -0.1375
## Museums
- **Tate Modern** - 51.5076, -0.0994
- **V&A** - 51.4966, -0.1722
{% /map %}<rf-map data-rune="map" data-rune-fields="{"zoom":"12","center":"51.5074, -0.1278","variant":"street","height":"medium","provider":"openstreetmap","interactive":"true","route":"false","cluster":"false"}">
<ol data-name="pins">
<li data-rune="map-pin" data-rune-fields="{"lat":"51.5114","lng":"-0.1263","address":"","url":"","group":"Restaurants"}" data-field="pin">
<span data-name="name">Dishoom</span>
<span data-name="description"></span>
</li>
<li data-rune="map-pin" data-rune-fields="{"lat":"51.5133","lng":"-0.1375","address":"","url":"","group":"Restaurants"}" data-field="pin">
<span data-name="name">Bao</span>
<span data-name="description"></span>
</li>
<li data-rune="map-pin" data-rune-fields="{"lat":"51.5076","lng":"-0.0994","address":"","url":"","group":"Museums"}" data-field="pin">
<span data-name="name">Tate Modern</span>
<span data-name="description"></span>
</li>
<li data-rune="map-pin" data-rune-fields="{"lat":"51.4966","lng":"-0.1722","address":"","url":"","group":"Museums"}" data-field="pin">
<span data-name="name">V&A</span>
<span data-name="description"></span>
</li>
</ol>
</rf-map>- Dishoom
- Bao
- Tate Modern
- V&A
<rf-map class="rf-map rf-map--street rf-map--medium" data-variant="street" data-height="medium" data-zoom="12" data-center="51.5074, -0.1278" data-provider="openstreetmap" data-interactive="true" data-route="false" data-cluster="false" data-elevation="flush" data-rune="map" data-density="compact">
<div data-name="container" class="rf-map__container">
<ol data-name="pins" class="rf-map__pins">
<li class="rf-map-pin" data-field="pin" data-lat="51.5114" data-lng="-0.1263" data-address="" data-url="" data-group="Restaurants" data-rune="map-pin" data-density="full">
<span data-name="name" class="rf-map-pin__name">Dishoom</span>
<span data-name="description" class="rf-map-pin__description"></span>
</li>
<li class="rf-map-pin" data-field="pin" data-lat="51.5133" data-lng="-0.1375" data-address="" data-url="" data-group="Restaurants" data-rune="map-pin" data-density="full">
<span data-name="name" class="rf-map-pin__name">Bao</span>
<span data-name="description" class="rf-map-pin__description"></span>
</li>
<li class="rf-map-pin" data-field="pin" data-lat="51.5076" data-lng="-0.0994" data-address="" data-url="" data-group="Museums" data-rune="map-pin" data-density="full">
<span data-name="name" class="rf-map-pin__name">Tate Modern</span>
<span data-name="description" class="rf-map-pin__description"></span>
</li>
<li class="rf-map-pin" data-field="pin" data-lat="51.4966" data-lng="-0.1722" data-address="" data-url="" data-group="Museums" data-rune="map-pin" data-density="full">
<span data-name="name" class="rf-map-pin__name">V&A</span>
<span data-name="description" class="rf-map-pin__description"></span>
</li>
</ol>
</div>
</rf-map>Height variants
Control the map height with the height attribute: small, medium (the default), large, or full. A single pin needs little room:
{% map height="small" zoom="15" %}
- **Tate Modern** - *Modern art in a former power station* - 51.5076, -0.0994
{% /map %}<rf-map data-rune="map" data-rune-fields="{"zoom":"15","center":"","variant":"street","height":"small","provider":"openstreetmap","interactive":"true","route":"false","cluster":"false"}">
<ol data-name="pins">
<li data-rune="map-pin" data-rune-fields="{"lat":"51.5076","lng":"-0.0994","address":"","url":"","group":""}" data-field="pin">
<span data-name="name">Tate Modern</span>
<span data-name="description">Modern art in a former power station</span>
</li>
</ol>
</rf-map>- Tate ModernModern art in a former power station
<rf-map class="rf-map rf-map--street rf-map--small" data-variant="street" data-height="small" data-zoom="15" data-center="" data-provider="openstreetmap" data-interactive="true" data-route="false" data-cluster="false" data-elevation="flush" data-rune="map" data-density="compact">
<div data-name="container" class="rf-map__container">
<ol data-name="pins" class="rf-map__pins">
<li class="rf-map-pin" data-field="pin" data-lat="51.5076" data-lng="-0.0994" data-address="" data-url="" data-group="" data-rune="map-pin" data-density="full">
<span data-name="name" class="rf-map-pin__name">Tate Modern</span>
<span data-name="description" class="rf-map-pin__description">Modern art in a former power station</span>
</li>
</ol>
</div>
</rf-map>Attributes
| Attribute | Type | Required | Description |
|---|---|---|---|
zoom | string | — | Initial zoom level of the map (higher values zoom in closer). |
center | string | — | Coordinates to center the map on (e.g. "48.8566, 2.3522"). |
variant | "street" | "satellite" | "terrain" | "dark" | "minimal" | — | Visual style of the map tiles: street, satellite, terrain, dark, or minimal. |
height | "small" | "medium" | "large" | "full" | — | Vertical size of the map container: small, medium, large, or full. |
provider | "openstreetmap" | "mapbox" | — | Tile provider used for rendering: openstreetmap or mapbox. |
interactive | boolean | — | Enable or disable pan and zoom interaction on the map. |
route | boolean | — | Enable or disable drawing a route line between pins. |
cluster | boolean | — | Enable or disable grouping nearby pins into clusters at low zoom. |
Universal attributes
bg
The background layer: image, video, gradient, flat overlay wash and legibility scrim, in a single injected layer behind the rune's content.
| Attribute | Type | Required | Description |
|---|---|---|---|
bg | string | — | Background preset applied to this block |
bg-from | string | — | Gradient start colour — a semantic token name (→ var(--rf-color-*)) |
bg-gradient | "to-t" | "to-b" | "to-l" | "to-r" | "to-tr" | "to-br" | "to-bl" | "to-tl" | — | Gradient direction (bounded named set) |
bg-gradient-type | "linear" | "radial" | "conic" | — | Gradient type |
bg-to | string | — | Gradient end colour — a semantic token name |
bg-via | string | — | Optional middle gradient stop — a semantic token name |
scrim | "top" | "bottom" | "left" | "right" | "none" | — | Scrim direction (heaviest edge); presence turns the scrim on, "none" opts out of the default cover scrim |
scrim-blur | "none" | "sm" | "md" | "lg" | — | Frost scrim blur amount |
scrim-strength | "sm" | "md" | "lg" | — | Gradient scrim strength |
scrim-tone | "dark" | "light" | — | Whether the scrim darkens (for light text) or lightens (for dark text) |
scrim-type | "gradient" | "frost" | — | Scrim treatment: gradient (default) or frost (backdrop blur) |
elevation
How far the rune sits off the page, from sunken to overlay. The theme decides what each step looks like.
| Attribute | Type | Required | Description |
|---|---|---|---|
elevation | "sunken" | "flush" | "flat" | "raised" | "floating" | "overlay" | "none" | "sm" | "md" | "lg" | — | Surface depth, from sunken to overlay. Deprecated: none, sm, md and lg (read as flat, raised, raised and floating) |
inset
Internal padding override.
| Attribute | Type | Required | Description |
|---|---|---|---|
inset | "flush" | "tight" | "default" | "loose" | "breathe" | — | Inner padding of this block |
motion
Scroll-reveal entrance. You choose its character; the theme decides how it moves.
| Attribute | Type | Required | Description |
|---|---|---|---|
reveal | "none" | "fade" | "slide" | "scale" | "blur" | — | Scroll-reveal entrance character (none|fade|slide|scale|blur); the theme owns the choreography |
stagger | boolean | — | Cascade this block's items in as it reveals (no-op on single-child runes) |
spacing
Block-level rhythm override.
| Attribute | Type | Required | Description |
|---|---|---|---|
spacing | "flush" | "tight" | "default" | "loose" | "breathe" | — | Vertical spacing above and below this block |
substrate
Generated pattern fills behind the content, drawn by the theme.
| Attribute | Type | Required | Description |
|---|---|---|---|
substrate | "dots" | "grid" | "lines" | "cross" | "checker" | "none" | — | Generated surface pattern |
substrate-fill | "inherit" | "inset" | — | Surface fill the pattern sits on (full colour stays with tint) |
substrate-opacity | "sm" | "md" | "lg" | — | Pattern ink strength |
substrate-size | "sm" | "md" | "lg" | — | Pattern cell size |
substrate-target | "self" | "media" | — | Which surface the pattern fills (overrides the rune/theme default) |
tint
Per-rune colour override: a named tint from the theme registry, with inline per-token overrides layered on top.
| Attribute | Type | Required | Description |
|---|---|---|---|
tint | string | — | Color tint preset applied to this block |
tint-mode | "auto" | "dark" | "light" | — | Whether the tint adapts to auto, dark, or light mode |
width
The track a block rune occupies.
| Attribute | Type | Required | Description |
|---|---|---|---|
width | "compact" | "narrow" | "content" | "wide" | "full" | — | Maximum width constraint for this block |
| Not available | Why |
|---|---|
| dropcap, reading | this rune declares no prose body |
| frame | this rune declares neither a `frameTarget` nor a media section |
| prominence | this rune has no page-section header or featured quotation |
map-pin
| Attribute | Type | Required | Description |
|---|---|---|---|
name | string | — | |
description | string | — | |
lat | string | — | |
lng | string | — | |
address | string | — | |
url | string | — | |
group | string | — |
Universal attributes
bg
The background layer: image, video, gradient, flat overlay wash and legibility scrim, in a single injected layer behind the rune's content.
| Attribute | Type | Required | Description |
|---|---|---|---|
bg | string | — | Background preset applied to this block |
bg-from | string | — | Gradient start colour — a semantic token name (→ var(--rf-color-*)) |
bg-gradient | "to-t" | "to-b" | "to-l" | "to-r" | "to-tr" | "to-br" | "to-bl" | "to-tl" | — | Gradient direction (bounded named set) |
bg-gradient-type | "linear" | "radial" | "conic" | — | Gradient type |
bg-to | string | — | Gradient end colour — a semantic token name |
bg-via | string | — | Optional middle gradient stop — a semantic token name |
scrim | "top" | "bottom" | "left" | "right" | "none" | — | Scrim direction (heaviest edge); presence turns the scrim on, "none" opts out of the default cover scrim |
scrim-blur | "none" | "sm" | "md" | "lg" | — | Frost scrim blur amount |
scrim-strength | "sm" | "md" | "lg" | — | Gradient scrim strength |
scrim-tone | "dark" | "light" | — | Whether the scrim darkens (for light text) or lightens (for dark text) |
scrim-type | "gradient" | "frost" | — | Scrim treatment: gradient (default) or frost (backdrop blur) |
elevation
How far the rune sits off the page, from sunken to overlay. The theme decides what each step looks like.
| Attribute | Type | Required | Description |
|---|---|---|---|
elevation | "sunken" | "flush" | "flat" | "raised" | "floating" | "overlay" | "none" | "sm" | "md" | "lg" | — | Surface depth, from sunken to overlay. Deprecated: none, sm, md and lg (read as flat, raised, raised and floating) |
inset
Internal padding override.
| Attribute | Type | Required | Description |
|---|---|---|---|
inset | "flush" | "tight" | "default" | "loose" | "breathe" | — | Inner padding of this block |
motion
Scroll-reveal entrance. You choose its character; the theme decides how it moves.
| Attribute | Type | Required | Description |
|---|---|---|---|
reveal | "none" | "fade" | "slide" | "scale" | "blur" | — | Scroll-reveal entrance character (none|fade|slide|scale|blur); the theme owns the choreography |
stagger | boolean | — | Cascade this block's items in as it reveals (no-op on single-child runes) |
spacing
Block-level rhythm override.
| Attribute | Type | Required | Description |
|---|---|---|---|
spacing | "flush" | "tight" | "default" | "loose" | "breathe" | — | Vertical spacing above and below this block |
substrate
Generated pattern fills behind the content, drawn by the theme.
| Attribute | Type | Required | Description |
|---|---|---|---|
substrate | "dots" | "grid" | "lines" | "cross" | "checker" | "none" | — | Generated surface pattern |
substrate-fill | "inherit" | "inset" | — | Surface fill the pattern sits on (full colour stays with tint) |
substrate-opacity | "sm" | "md" | "lg" | — | Pattern ink strength |
substrate-size | "sm" | "md" | "lg" | — | Pattern cell size |
substrate-target | "self" | "media" | — | Which surface the pattern fills (overrides the rune/theme default) |
tint
Per-rune colour override: a named tint from the theme registry, with inline per-token overrides layered on top.
| Attribute | Type | Required | Description |
|---|---|---|---|
tint | string | — | Color tint preset applied to this block |
tint-mode | "auto" | "dark" | "light" | — | Whether the tint adapts to auto, dark, or light mode |
width
The track a block rune occupies.
| Attribute | Type | Required | Description |
|---|---|---|---|
width | "compact" | "narrow" | "content" | "wide" | "full" | — | Maximum width constraint for this block |
| Not available | Why |
|---|---|
| dropcap, reading | this rune declares no prose body |
| frame | this rune declares neither a `frameTarget` nor a media section |
| prominence | this rune has no page-section header or featured quotation |