v1.2.0

Box

Box is a general-purpose container with sx-like shorthand attributes that map directly to CSS properties.

Basic

A box with background, color, padding and border-radius attributes.
<me-box bgcolor="var(--me-palette-primary-main)" color="white" p="16px" border-radius="8px"> content </me-box>

Flex Layout

Item 1 Item 2 Item 3
<me-box display="flex" gap="8px" align-items="center"> <me-box bgcolor="..." p="8px 16px">Item 1</me-box> <me-box bgcolor="..." p="8px 16px">Item 2</me-box> </me-box>

Spacing Shorthands

Single-letter shorthands work for padding (p, pt, pr, pb, pl) and margin (m, mt, mr, mb, ml).

pt=32px, pb=32px, pl=16px, pr=16px
<me-box pt="32px" pb="32px" pl="16px" pr="16px">...</me-box>

API

AttributeCSS PropertyDescription
displaydisplaydisplay value.
flex-directionflex-direction
justify-contentjustify-content
align-itemsalign-items
gapgap
bgcolorbackground-colorBackground color.
colorcolorText color.
p / paddingpaddingPadding shorthand.
pt / pr / pb / plpadding-top/right/bottom/leftPer-side padding.
m / marginmarginMargin shorthand.
mt / mr / mb / mlmargin-top/right/bottom/leftPer-side margin.
width / heightwidth / heightSize.
border-radiusborder-radius
overflowoverflow
positionposition
z-indexz-index