The typographic variant to apply, controlling font family, size,
line height, and weight.
children
React.ReactNode
The content to be rendered inside the component.
Examples
Default
constDefault=()=><Textvariant="body-md">The quick brown fox jumps over the lazy dog.</Text>;
All Variants
Important: Setting the variant prop to a heading variant will not automatically render a heading element. Use the render prop to render a heading element with the appropriate level.
constAllVariants=()=>(<Stackdirection="column"gap="lg"style={{color:'var(--wpds-color-fg-content-neutral)'}}>{(['heading-2xl','heading-xl','heading-lg','heading-md','heading-sm','body-xl','body-lg','body-md','body-sm',]asconst).map((variant)=>(<Stackkey={variant}direction="column"gap="xs"><Textvariant="heading-sm">{variant}</Text><Textvariant={variant}> The quick brown fox jumps over the lazy dog.
</Text></Stack>))}</Stack>);
With Render Prop
constWithRenderProp=()=>(<Stackdirection="column"gap="md"><Textvariant="heading-2xl"render={<h1/>}> Page Title
</Text><Textvariant="heading-xl"render={<h2/>}> Section Heading
</Text><Textvariant="body-md"render={<p/>}> A paragraph of body text rendered as a semantic paragraph
element.
</Text></Stack>);
The string to search for and highlight within the text. Case
insensitive. Multiple matches.
textRequired
string
The string of text to be tested for occurrences of then given
highlight.
Examples
Default
constDefault=()=>{return(<TextHighlighttext="We call the new editor Gutenberg. The entire editing experience has been rebuilt for media rich pages and posts."highlight="Gutenberg"/>);};