Wraps html text with some preset style options in a configurable tag container.

Parameters:
NameTypeDescription
propsobject

Component props.

Properties
NameTypeDescription
asHtmlboolean

Whether or not to accept HTML in the content

childrenJSX.Element

React element children.

colorstring

The text color.

contentstring

The text content.

customAttributesobject

Custom attributes for the component.

customClassesstring | Array | object

Custom classes for the component.

sizestring

The font size for the heading.

spacingstring | number | Array | object

The spacing for the component, as a string, number, array, or object.

tagNamestring

The tag used for the container element.

weightstring

The font weight for the heading.

refobject | null

Ref to the component.

Since
  • 1.1.15
Returns:

The text component.

Type: 
JSX.Element
Example
import Text from '@gravityforms/components/react/admin/elements/Text';

return <Text content="Hello world" />;