Using Grommet for HPE?See Box examples and guidance.
string
"a user friendly label for screen readers"
string
"start"
"center"
"end"
"baseline"
"stretch
string
"start"
"center"
"end"
"between"
"around"
"stretch"
string
"start"
"center"
"end"
"stretch"
"baseline"
string
"fadeIn"
"fadeOut"
"jiggle"
"pulse"
"rotateLeft"
"rotateRight"
"slideUp"
"slideDown"
"slideLeft"
"slideRight"
"zoomIn"
"zoomOut"
object
{ type: "...", delay: 0, duration: 1000, size: "xsmall" }
array
["fadeIn", "slideDown", "..."]
string
"div"
function
() => {}
element
<span />
string
"neutral-1"
"url(//my.com/assets/img.png)"
object
{ color: "neutral-1", dark: true, opacity: true, position: "bottom", repeat: "no-repeat", size: "cover", image: "url(//my.com/assets/img.png)", clip: "text", rotate: 45 }
{ dark: "light-2", light: "dark-2" }
"weak"
"medium"
"strong"
true
any CSS for background-position
"no-repeat"
"repeat"
"string"
"cover"
"contain"
"string"
"text"
"border-box"
"padding-box"
"content-box"
string
"xxsmall"
"xsmall"
"small"
"medium"
"large"
"xlarge"
"xxlarge"
"full"
"1/2"
"1/3"
"2/3"
"1/4"
"2/4"
"3/4"
"auto"
boolean
true
false
string
"top"
"left"
"bottom"
"right"
"start"
"end"
"horizontal"
"vertical"
"all"
"between"
object
{ color: string | { dark: string, light: string }, size: "medium", style: "dashed", side: "all" }
array
[ { color: "black", size: "small", style: "solid", side: "top" }, { color: "black", size: "medium", style: "dotted", side: "bottom" } ]
"xsmall"
"small"
"medium"
"large"
"xlarge"
"any CSS size"
"solid"
"dashed"
"dotted"
"double"
"groove"
"ridge"
"inset"
"outset"
"hidden"
"top"
"left"
"bottom"
"right"
"horizontal"
"vertical"
"all"
boolean
true
false
string
"row"
"column"
"row-responsive"
"row-reverse"
"column-reverse"
string
"none"
"xsmall"
"small"
"medium"
"large"
"xlarge"
"any custom elevation name in the current theme"
string
"horizontal"
"vertical"
boolean
true
false
string
"grow"
"shrink"
boolean
true
false
object
{ grow: number, shrink: number }
boolean
true
false
The amount of spacing between child elements. This should not be used in conjunction with 'wrap' as the gap elements will not wrap gracefully. If a child is a Fragment, Box will not add a gap between the children of the Fragment. To use the CSS gap attribute to add space between children of the Box (including children of a Fragment child of the Box), set cssGap to true on the Box or set options={{ box: { cssGap: true } }} on the nearest Grommet parent component.
string
"none"
"xsmall"
"small"
"medium"
"large"
"xlarge"
"any CSS size"
object
{row: 'xlarge', column: '30px' }
string
"xxsmall"
"xsmall"
"small"
"medium"
"large"
"xlarge"
"xxlarge"
"any CSS size"
object
{ min: "...", max: "..." }
boolean
true
false
string
"background"
object
{ color: "...", dark: "...", image: "string", position: "string", opacity: "...", repeat: "...", size: "...", light: "string" }
{ background: { color: "...", dark: "...", image: "string", position: "string", opacity: "...", repeat: "...", size: "...", light: "string" }, elevation: "..." }
"string"
{ dark: "string", light: "string" }
boolean
"string"
boolean
number
"weak"
"medium"
"strong"
"no-repeat"
"repeat"
"string"
"cover"
"contain"
"string"
"none"
"xsmall"
"small"
"medium"
"large"
"xlarge"
"string"
string
"around"
"between"
"center"
"end"
"evenly"
"start"
"stretch"
string
"none"
"xxsmall"
"xsmall"
"small"
"medium"
"large"
"xlarge"
object
{ vertical: "...", horizontal: "...", top: "...", bottom: "...", left: "...", right: "..." }
function
() => {}
string
"auto"
"hidden"
"scroll"
"visible"
"any CSS overflow"
object
{ vertical: "...", horizontal: "..." }
string
"none"
"xxsmall"
"xsmall"
"small"
"medium"
"large"
"xlarge"
"any CSS size"
object
{ vertical: "...", horizontal: "...", top: "...", bottom: "...", left: "...", right: "...", start: "...", end: "..." }
boolean
true
false
boolean
true
false
string
"xsmall"
"small"
"medium"
"large"
"xlarge"
"full"
"any CSS size"
object
{ size: "...", corner: "..." }
"top"
"left"
"bottom"
"right"
"top-left"
"top-right"
"bottom-left"
"bottom-right"
boolean
true
false
object
{ animation: 'fadeIn', message: { start: 'Loading', end: 'Loading complete' }}
same options as the Box animation property
{ dark: ['background', 'background-front'], light: ['background', 'background-back'] }
2
"Loading"
{ start: 'Loading', end: 'Loading complete' }
string
"div"
function
() => {}
string
"xxsmall"
"xsmall"
"small"
"medium"
"large"
"xlarge"
"xxlarge"
"any CSS size"
object
{ min: "...", max: "..." }
At its core, the Box component is a regular <div> element. Thus, both DOM and React properties, methods, and events are accessible. To read up on all of the possible DOM attributes and types available for div elements, check out this MDN Web Documents page. To learn more about DOM events and methods, you can read more on the MDN Web Events documentation page.
Also, feel free to read about the types of React events available, or see how DOM attributes change in React. Working in tandem with Styled Components, you also have access to the as property.
object
{ duration: '1s', jiggle: { duration: '0.1s' } }
object
{ xsmall: '1px', small: '2px', medium: '4px', large: '12px', xlarge: '24px, }
object
{ light: { none: 'none', xsmall: '0px 1px 2px rgba(100, 100, 100, 0.50)', small: '0px 2px 4px rgba(100, 100, 100, 0.50)', medium: '0px 3px 8px rgba(100, 100, 100, 0.50)', large: '0px 6px 12px rgba(100, 100, 100, 0.50)', xlarge: '0px 8px 16px rgba(100, 100, 100, 0.50)', }, dark: { none: 'none', xsmall: '0px 2px 2px rgba(255, 255, 255, 0.40)', small: '0px 4px 4px rgba(255, 255, 255, 0.40)', medium: '0px 6px 8px rgba(255, 255, 255, 0.40)', large: '0px 8px 16px rgba(255, 255, 255, 0.40)', xlarge: '0px 10px 24px rgba(255, 255, 255, 0.40)', }, }
string
"brand"
object
{ dark: rgba(255, 255, 255, 0.33), light: rgba(0, 0, 0, 0.33), }
string
"active"
object
{ dark: "string", light: "string" }
string
"medium"
number
0.5
string
"black"
object
{ dark: "white", light: "black" }
object
{ xxsmall: '48px', xsmall: '96px', small: '192px', medium: '384px', large: '768px', xlarge: '1152px', xxlarge: '1536px', full: '100%', }
string
"small"
object
{ edgeSize: { none: '0px', hair: '1px', xxsmall: '3px', xsmall: '6px', small: '12px', medium: '24px', large: '48px', xlarge: '96px', responsiveBreakpoint: 'small', }, }
object
{ small: { value: '768px', borderSize: { xsmall: '1px', small: '2px', medium: '4px', large: '6px', xlarge: '12px', }, edgeSize: { none: '0px', hair: '1px', xxsmall: '2px', xsmall: '3px', small: '6px', medium: '12px', large: '24px', xlarge: '48px', }, size: { xxsmall: '24px', xsmall: '48px', small: '96px', medium: '192px', large: '384px', xlarge: '768px', full: '100%', }, }, medium: { value: '1536px' }, large: {}, }