Skip to content

Text

The <Text> primitive places a text label at a given position. Control font size, weight, alignment, and color to add labels, titles, annotations, and axis markers to your scenes.

Hello Elucim
0.00s / 3.97s · F0
PropTypeDefaultDescription
xnumber0X coordinate of the text anchor point
ynumber0Y coordinate of the text baseline
contentstring (children)''The text to display
fillstring'currentColor'Text color
fontSizenumber16Font size in pixels
fontFamilystring'sans-serif'Font family
fontWeightstring | number'normal'Font weight (e.g. 'bold', 600)
textAnchor'start' | 'middle' | 'end''start'Horizontal alignment relative to x
opacitynumber1Opacity from 0 to 1
elements: {
title: {
id: 'title',
type: 'text',
role: 'title',
props: { type: 'text', x: 250, y: 80, content: 'Hello Elucim', fill: '$title', fontSize: 32, textAnchor: 'middle', fontWeight: 'bold' },
},
subtitle: {
id: 'subtitle',
type: 'text',
role: 'caption',
props: { type: 'text', x: 250, y: 140, content: 'Animate concepts. Illuminate understanding.', fill: '$muted', fontSize: 16, textAnchor: 'middle' },
},
}