Renders a simple box component for containing width or height.

Parameters:
NameTypeDescription
propsobject

Component props.

Properties
NameTypeDescription
childrenJSX.Element

React element children.

customAttributesobject

Custom attributes for the component.

customClassesstring | Array | object

Custom classes for the component.

displaystring

The display property for the box.

setDisplayboolean

Whether to set the display property for the box.

spacingstring | number | Array | object

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

tagNamestring

The tagname for the box, defaults to div.

unitstring

The css units for the x and y props.

xnumber

The width property.

xPropstring

The css property in react style syntax for the width, defaults to maxWidth.

ynumber

The height property.

yPropstring

The css property in react style syntax for the height, defaults to minHeight.

refobject | null

Ref to the component.

Since
  • 1.1.15
Returns:

The box component.

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

return (
    <Box tagName="span">
        { 'children' }
    </Box>
);