Title
The built-in title tag — a Mantine heading (h1–h6) with an explicit level, visual size independent of the level, and the full typography surface: color, align, transform, weight. Usage, options, and live examples.
{% title %} is a built-in tag for headings — the Mantine
Title element (<h1>–<h6>) with explicit control over the level and its styling. A
plain Markdown # heading still works for ordinary headings; reach for this tag when you
want a heading with a specific color, alignment, transform, or a visual size that differs
from its level.
Use it as {% title %} in Markdown, or call it from Python logic
(loops, snippets) via component('aardvark', 'title', …).
Demonstrations
Order
order sets the heading level, 1–6 (<h1> … <h6>). It controls both the semantics
and the default visual size. Out-of-range values fall back to Mantine’s default:
Order 1
Order 3
Order 6
{% title order=1 %}Order 1{% endTitle %}
{% title order=3 %}Order 3{% endTitle %}
{% title order=6 %}Order 6{% endTitle %}
for n in (1, 3, 6):
component('aardvark', 'title', children=f'Order {n}', order=n)
Visual size
Set size to detach the visual size from the level — a small <h2> for SEO without a
giant heading, say. It takes a heading token (h1–h6), a Mantine size (xs–xl), or
any CSS size:
An h2 that looks like an h5
An h2 at 3rem
{% title order=2 size='h5' %}An h2 that looks like an h5{% endTitle %}
{% title order=2 size='3rem' %}An h2 at 3rem{% endTitle %}
component('aardvark', 'title', children='An h2 that looks like an h5', order=2, size='h5')
component('aardvark', 'title', children='An h2 at 3rem', order=2, size='3rem')
Color, align, transform, weight
The usual typography props apply: c (color), ta (align), tt (transform), and fw
(weight). lh and lts tune line height and letter spacing:
Centered grape heading
Bold spaced caps
{% title order=3 c='grape' ta='center' %}Centered grape heading{% endTitle %}
{% title order=3 tt='uppercase' fw=900 lts='0.1em' %}Bold spaced caps{% endTitle %}
component('aardvark', 'title', children='Centered grape heading',
order=3, c='grape', ta='center')
component('aardvark', 'title', children='Bold spaced caps',
order=3, tt='uppercase', fw=900, lts='0.1em')
Content and spacing
Give the heading inline with text, or as the block body. The block body renders inline
Markdown (**bold**, `code`, [links]). Margin props (mt, mb, …) space the
heading from its neighbours:
Inline heading
tokenHeading with emphasis and a token
{% title order=4 text='Inline heading' %}
{% title order=4 mt='lg' mb='xs' %}Heading with **emphasis** and a `token`{% endTitle %}
component('aardvark', 'title', order=4, text='Inline heading')
component('aardvark', 'title', children='Heading with **emphasis** and a `token`',
order=4, mt='lg', mb='xs')
With other components
Pair a title with Text for a lead paragraph, or sit one above a Table as a section header. Here a heading and a dimmed standfirst form a section intro:
Quick start
vark build.Install the binary, scaffold a site, and run vark build.
{% title order=3 mb='xs' %}Quick start{% endTitle %}
{% text c='dimmed' %}Install the binary, scaffold a site, and run `vark build`.{% endText %}
component('aardvark', 'title', children='Quick start', order=3, mb='xs')
component('aardvark', 'text',
children='Install the binary, scaffold a site, and run `vark build`.',
c='dimmed')
Attributes
Omit any attribute to take its Mantine default.
| Attribute | Valid values | Description |
|---|---|---|
text |
String | The heading text, when not using the block body. Plain text (no Markdown). |
order |
1–6 |
Heading level (<h1>–<h6>); sets semantics and default size. Out-of-range falls back to the default. |
size |
h1–h6, xs–xl, or any CSS size |
Visual size, independent of order. |
c |
Theme color, dimmed, or any CSS color |
Text color. |
ta |
left, center, right, justify |
Text alignment. |
tt |
uppercase, capitalize, lowercase, none |
Text transform. |
fw |
bold, normal, or a number (700) |
Font weight. |
lh |
Number or any CSS line-height | Line height. |
lts |
Any CSS letter-spacing (0.1em) |
Letter spacing. |
id |
String | HTML id on the rendered heading, for CSS / JS selectors and anchor links. |
m, mt, mb, ml, mr, mx, my |
Mantine size token or any CSS value | Margin (all, top, bottom, left, right, horizontal, vertical). |
CSS Selectors
Target the rendered element through its island marker, [data-aardvark-island="Title"], or through the Mantine Styles API classes:
/* Every rendered Title carries this island marker */
[data-aardvark-island="Title"] { }
/* Mantine Styles API classes */
.mantine-Title-root { }
Injecting Attributes
attr={…} forwards raw HTML attributes — including event handlers — straight onto the rendered element, so you can wire DOM behavior the tag does not expose. The handler can be a full multi-line script, not just one expression — this one logs the value to the console and shows it in an alert:
Order 1
{% title order=1 attr={'onclick': '''
const value = this.innerText;
console.log('attr demo value:', value);
alert(value);
'''} %}Order 1{% endTitle %}
component('aardvark', 'title', children='Order 1', order=1, attr={'onclick': '''
const value = this.innerText;
console.log('attr demo value:', value);
alert(value);
'''})