Text, Heading, Body and BodySmall set text from the font, size, weight, line-height and color tokens. Each renders on the server. The element is chosen separately from the size, so the document outline stays correct whatever the visual design.
tsx
import { Body, BodySmall, Heading, Text } from'@blocks/design-system'
Each station reports snow depth, water content and temperature. Readings arrive hourly and are checked against nearby stations before they appear here.
Snow depth
Depth is measured by an ultrasonic sensor above a level board. Sudden drops usually mean wind, not melt.
Sensor accuracy is about half an inch.
Water content
Snow water equivalent is the depth of water the snowpack would make if it all melted at once.
import { Body, BodySmall, Heading, Measure, Text } from'@blocks/design-system'exportdefaultfunctionStationGuide() {
return (
<Measureas="article"aria-labelledby="guide-title"marginX="none">
<Headingas="h2"id="guide-title"fontSize="xl">
Station guide
</Heading>
<Body>
Each station reports snow depth, water content and temperature. Readings arrive hourly and are checked against
nearby stations before they appear here.
</Body>
<Headingas="h3"fontSize="lg">
Snow depth
</Heading>
<Body>
Depth is measured by an ultrasonic sensor above a level board. <TextfontWeight="semibold">Sudden drops</Text>{' '}
usually mean wind, not melt.
</Body>
<BodySmallcolor="text-muted">Sensor accuracy is about half an inch.</BodySmall>
<Headingas="h3"fontSize="lg">
Water content
</Heading>
<Body>Snow water equivalent is the depth of water the snowpack would make if it all melted at once.</Body>
</Measure>
)
}
Text is the base the others build on. It renders a <span> unless you pass as, and takes fontSize, fontWeight, fontFamily, lineHeight and color tokens plus margin props. Colors are semantic tokens such as text-muted and danger-text, which stay readable in both themes.
Storm total 18 inSince Tuesday eveningSTN-651 · 05:00 UTCAvalanche warning in effect
Heading renders an <h3> in the heading font, size and weight unless you pass as (h1–h6 or span). Pick the level for the outline and fontSize for the look. A span gives heading styling to text that should not appear in the outline. Themes change heading type through --ds-font-heading.
import { Heading, Stack } from'@blocks/design-system'exportdefaultfunctionHeadingLevels() {
return (
<Stackgap="sm">
<Headingas="h2"fontSize="lg">
A second-level heading at the lg size
</Heading>
<Headingas="h3"fontSize="xxl">
A third-level heading at the xxl size
</Heading>
<Headingas="span"fontSize="md"color="text-muted">
A heading style on a span, outside the outline
</Heading>
</Stack>
)
}