Text
Expressive typography
Semantic elements and visual roles stay independent.
Type scale
Headline large
Headline small
import { Surface, Text } from '@language-lit/material3-expressive'
export function TextExample() {
return (
<Surface
as="section"
aria-labelledby="text-example-title"
color="surface-container"
shape="extra-large"
className="text-example"
>
<Text
as="h2"
id="text-example-title"
variant="displaySmall"
emphasis="emphasized"
>
Expressive typography
</Text>
<Text as="p" variant="bodyLarge">
Semantic elements and visual roles stay independent.
</Text>
<Surface color="inverse-surface" shape="medium" className="text-example__inverse">
<Text variant="labelLarge" emphasis="emphasized">
Content color is inherited
</Text>
</Surface>
<Text as="h3" variant="titleMedium" emphasis="emphasized">
Type scale
</Text>
<Text as="div" variant="displayLarge">
Display large
</Text>
<Text as="strong" variant="displayMedium">
Display medium
</Text>
<Text as="h1" variant="headlineLarge">
Headline large
</Text>
<Text as="div" variant="headlineMedium">
Headline medium
</Text>
<Text as="blockquote" variant="headlineSmall">
Headline small
</Text>
<Text as="div" variant="titleLarge">
Title large
</Text>
<Text as="div" variant="titleSmall">
Title small
</Text>
<Text as="div" variant="bodyMedium" emphasis="baseline">
Body medium (explicit baseline)
</Text>
<Text as="div" variant="bodySmall">
Body small
</Text>
<Text as="label" variant="labelMedium">
Label medium
</Text>
<Text as="div" variant="labelSmall">
Label small
</Text>
</Surface>
)
}Text applies the complete Material 3 type scale to an explicitly selected
native HTML element. Visual typography and document semantics are independent.
import { Text } from '@language-lit/material3-expressive'
import '@language-lit/material3-expressive/styles.css'
<Text as="h1" variant="displayLarge" emphasis="emphasized">
Account
</Text>
<Text as="p" variant="bodyLarge">
The heading level comes from `as`; the visual scale comes from `variant`.
</Text>Contract
asdefaults tospan. It acceptsspan,p,div,h1–h6,label,legend,strong,em,small,blockquote, orfigcaption.variantdefaults tobodyLargeand accepts every Material display, headline, title, body, and label size:Large,Medium, andSmall.emphasisdefaults tobaseline.emphasizedselects the current Material 3 Expressive counterpart of the same role.- Native attributes, ARIA/data attributes, styles, classes, handlers, children, and a correctly narrowed ref are forwarded to the selected element.
- Text removes the selected element's user-agent margin so the same visual role has predictable component layout. It does not change its native display mode.
variant="displayLarge" does not create a heading. Choose as="h1" through
as="h6" from the page's actual document structure. Conversely, a real heading
may use a smaller visual role without losing its heading level.
Expressive type scale
The 15 roles are:
displayLarge,displayMedium,displaySmallheadlineLarge,headlineMedium,headlineSmalltitleLarge,titleMedium,titleSmallbodyLarge,bodyMedium,bodySmalllabelLarge,labelMedium,labelSmall
Every role has baseline and emphasized styling. The emphasized scale is not a generic bold switch: it is a separately themeable Material scale. A theme may change its family, weight, size, line height, tracking, or variable axes without changing the baseline counterpart.
Typography tokens and fonts
Text resolves the selected role directly through
--m3e-sys-typescale-{emphasis}-{kebab-role}-* variables for font family, weight,
size, line height, letter spacing, and the CRSV, FILL, GRAD, HEXP,
ROND, opsz, slnt, wdth, and wght axes. There are no Text component
tokens because first-party Text consumes the system type scale and inherited
content color directly.
Rendering Text never downloads or injects a font. Applications own their font
files and @font-face declarations, then set theme.reference.typeface.brand
and .plain. A font ignores variable axes it does not support; use a capable
variable font to realize the full configured axis treatment.
Text inherits color from its surroundings. A Surface supplies the matching
Material content color, while ordinary consumer CSS can override color and
other presentation when a deliberate exception is needed.
Accessibility and adaptation
Text adds no role, focus stop, keyboard behavior, accessible state, or
interaction. Native headings, labels, legends, and text-level semantics remain
authoritative. Use label only with a valid form-control relationship, and keep
heading levels structurally correct regardless of visual role.
The component has no motion, physical-direction layout, breakpoint, or forced- color override. Browser text scaling, writing direction, forced colors, and consumer responsive CSS remain active. Automatic text fitting and truncation are layout policies rather than Expressive type roles and are outside this foundation API.