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.

iconstring

The icon for the label tooltip.

iconPrefixstring

The icon prefix for the label.

isVisibleboolean

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

labelstring

Label text.

loaderPropsobject

Props passed to the RingLoader when loading. All RingLoader props can be overridden.

loadingboolean

If true, displays a RingLoader inline with the label text.

loadingDelaynumber

Delay in ms before the loading indicator appears. Prevents flash for fast operations. Default 0.

loadingTextstring

Optional text to display in place of label while loading. If empty, the label text remains.

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.

tagNamestring

The HTML tag to use for the label element (e.g., 'label', 'legend').

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>;