A label component.

Parameters:
NameTypeDescription
propsobject

Component props.

Properties
NameTypeDescription
childrenJSX.Element | string

React element children.

customAttributesobject

Custom attributes for the component.

customClassesstring | Array | object

Custom classes for the component.

htmlForstring

The for attribute for the label.

iconPrefixstring

The icon prefix for the label.

isVisibleboolean

If label is visible (true) or hidden (false).

labelstring

Label text.

lockedboolean

If the label is locked (disables form element and puts an icon with optional tooltip next to label).

lockedMessagestring

The message to display when the label is locked, in a tooltip. (optional)

sizestring

The font size for the label.

spacingstring | number | Array | object

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

weightstring

The font weight for the label.

refobject | null

Ref to the component.

Since
  • 1.1.18
Returns:

The Label component.

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

return <Label htmlFor="input-id">{ 'Input label' }</Label>;