Renders a simple box component for containing width or height.

Parameters:
NameTypeAttributesDefaultDescription
childrenReact.ReactNode | Array.<React.ReactNode><optional>

React element children

customAttributesRecord.<string, any><optional>

Custom attributes for the component

customClassesstring | Array.<string> | Record.<string, boolean><optional>

Custom classes for the component

displaystring<optional>
'block'

The display property for the box

setDisplayboolean<optional>
true

Whether to set the display property for the box

spacingstring | number | Array.<string> | Record.<string, any><optional>
''

The spacing for the component

tagNamestring<optional>
'div'

The tagname for the box

unitstring<optional>
'px'

The css units for the x and y props

xnumber<optional>
0

The width property

xPropstring<optional>
'maxWidth'

The css property in react style syntax for the width

ynumber<optional>
0

The height property

yPropstring<optional>
'minHeight'

The css property in react style syntax for the height

refReact.RefObject.<HTMLElement> | 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>
);