Usage guidance
In general, when dealing with text, Paragraph component should be used. This Text
component is meant to be used mainly as a building block for other components by taking advantage of the as
prop, or as an inline text wrapper.
Text
is available in three different sizes: small
, medium
and large
. In most cases, the default value should be used.
It also has basic typography-related styles applied, such as font-family
, font-size
, and font-weight
.
Best practices
Examples
Basic usage
Sizes
Playground
Props
Text
In addition to all custom props listed below, Text
accepts all props regular HTMLSpan
would, such as aria-
and data-
attributes.
Name | Type | Description |
---|---|---|
as | React.ElementType | The element used to render this component, e.g. |
children Required | React.ReactNode | The text content of the component. |
size | large medium small | Defines the size of the Text. In most cases, the default size should be used. Default: medium |
Imports
You can import the following components, utilities or types from this module:
import { Text } from '@datacamp/waffles/text';import type { TextProps } from '@datacamp/waffles/text';