Renders a simple box component for containing width or height.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
children | React. | <optional> | React element children | |
customAttributes | Record.<string, any> | <optional> | Custom attributes for the component | |
customClasses | string | | <optional> | Custom classes for the component | |
display | string | <optional> | 'block' | The display property for the box |
setDisplay | boolean | <optional> | true | Whether to set the display property for the box |
spacing | string | | <optional> | '' | The spacing for the component |
tagName | string | <optional> | 'div' | The tagname for the box |
unit | string | <optional> | 'px' | The css units for the x and y props |
x | number | <optional> | 0 | The width property |
xProp | string | <optional> | 'maxWidth' | The css property in react style syntax for the width |
y | number | <optional> | 0 | The height property |
yProp | string | <optional> | 'minHeight' | The css property in react style syntax for the height |
ref | React.RefObject.<HTMLElement> | | Ref to the component |
- Since
- 1.1.15
- Source
Returns:
The box component
- Type:
- JSX.
Element
Example
import Box from '@gravityforms/components/react/admin/elements/Box';
return (
<Box tagName="span">
{ 'children' }
</Box>
);