Skip to main content

Common Examples

To use the Text, import it from @servicetitan/anvil2-ai-kit and pass a required text prop. The kit forbids children. text must be HTML phrasing content: inline nodes only, not block elements.
Prefer Carto components inside text when both a raw HTML element and a kit component exist: Link over <a>, kit icons over raw <svg>.For truncation with Show more / Show less, use TruncatedText.

Headline

Set variant="headline" and a required el ("h1""h6") so the semantic level is independent of visual size. Headline size defaults to "major".

Body

Body is the default variant and renders a <p>. Size defaults to "regular".

Inline body

Set inline on body text to render a <span> instead of a <p> so fragments compose inside other text.

Eyebrow

Eyebrow text always renders a <span> and does not accept size, el, or inline.

Highlighted

Set highlighted to apply the suggested-change treatment on any variant.

React Accessibility

  • Choose el on headlines to match document structure, not visual size.
  • Body text that includes interactive children such as Link must stay phrasing content so the wrapping <p> or <span> remains valid HTML.
Last modified on August 28, 2026