Primals
Box

Box Component

The Box component is a primitive component that can be used to create a box with padding and other style properties.

Props

The Box component accepts the following props:

PropDescriptionType
childrenThe content of the Box component.Node
radiusA string that sets the border radius of the Box.String
bgA string that sets the background color of the Box.String
backgroundColorA string that sets the background color of the Box.String
wA string that sets the width of the Box.String
hA string that sets the height of the Box.String
widthA string that sets the width of the Box.String
heightA string that sets the height of the Box.String
pA string that sets the padding of the Box.String
ptA string that sets the top padding of the Box.String
prA string that sets the right padding of the Box.String
pbA string that sets the bottom padding of the Box.String
plA string that sets the left padding of the Box.String
pxA string that sets the horizontal padding of the Box.String
pyA string that sets the vertical padding of the Box.String
paddingA string that sets the padding of the Box.String
mA string that sets the margin of the Box.String
mtA string that sets the top margin of the Box.String
mbA string that sets the bottom margin of the Box.String
mrA string that sets the right margin of the Box.String
mlA string that sets the left margin of the Box.String
mxA string that sets the horizontal margin of the Box.String
myA string that sets the vertical margin of the Box.String
marginA string that sets the margin of the Box.String
sizeA string that sets the size of the Box. It can be 'sm' or 'lg'.String

Usage

Hello, world!

<Box
  bg="red-600"
  size="sm"
>
  Hello, world!
</Box>