Documentation Index
Fetch the complete documentation index at: https://anvil.servicetitan.com/llms.txt
Use this file to discover all available pages before exploring further.
- Implementation
- Text Props
Common Examples
Text variants
TheText component accepts one of three options for the variant prop:"body"(default): renders as HTMLporspanelement, ifinlineis set totrue"eyebrow": renders as HTMLspanelement"headline": renders as HTML heading element (h1throughh4) element, based onelprop
Body
Eyebrow
Headline
Nesting body text
When using body text within body text, make sure to use theinline prop on any of the child Body components to render a span instead of p.Subdued body text
Ifsubdued is set to true on a body text, it will use a de-emphasized color:The useAccessibleColor hook
The Anvil2useAccessibleColor hook makes it easy to determine which text color to use given a specific background color without making it inaccessible. This hook accepts two parameters, and returns an object with both foreground and background colors. In the case that no color can be made accessible with the given color, the background color will be adjusted until it can.