Base component for all Pluma components. All components in Pluma are built using the Box component. This means Pluma components all accept the Box component's props.
The Box component can be imported via:
The Box component accepts a number of style utility props, which can be used for layout and styling.
Because all Pluma components use Box, those props are available throughout the library.
Layout props such as display, flexDirection, gap, padding and margin also accept an object keyed by breakpoint, like flexDirection={{ base: 'column', md: 'row' }}; see Responsive layout.
Square brackets pass a raw CSS value to a style utility prop: px="[21px]" sets the left and right padding to 21px. Every prop that sets a single CSS property accepts brackets, including spacing and sizing props, display, position, cursor, zIndex, flexbox alignment and text props. truncate, visuallyHidden, centerBaseline and centerBaselineBefore don't. Spacing and sizing props take CSS lengths, percentages, calc() and var(). Shorthand props such as px apply the value to each side, and brackets also work in per-breakpoint objects.
In Vite apps, bracketed values need the style utility plugin and must be written in full in source or listed in its safelist. The gap props owned by List and ListItem remain token-backed.
Spacing prop values are based on the spacing tokens in the Pluma design system and follow the formula (token / 100) * 8px. This includes:
0 (0px)025 (2px)050 (4px)075 (6px)100 (8px)125 (10px)150 (12px)175 (14px)200 (16px)225 (18px)250 (20px)275 (22px)300 (24px)350 (28px)400 (32px)450 (36px)500 (40px)600 (48px)800 (64px)900 (72px)1000 (80px)1200 (96px)1600 (128px)2000 (160px)2400 (192px)2800 (224px)3200 (256px)icon-lg (var(--pluma-space-400))icon-md (var(--pluma-space-300))icon-sm (var(--pluma-space-200))icon-v2-lg (var(--pluma-space-300))icon-v2-md (var(--pluma-space-250))icon-v2-sm (var(--pluma-space-200))icon-v2-xl (var(--pluma-space-400))icon-xl (var(--pluma-space-600))icon-xs (var(--pluma-space-175))icon-xxs (var(--pluma-space-150))padding-button-medium (var(--pluma-space-150))padding-button-small (var(--pluma-space-100))padding-header (var(--pluma-space-250))Padding uses space tokens and can be applied using the following props:
pt (padding top)pr (padding right)pb (padding bottom)pl (padding left)px (padding horizontal)py (padding vertical)p (padding on all sides)Margin uses space tokens and can be applied using the following props:
mt (margin top)mr (margin right)mb (margin bottom)ml (margin left)mx (margin horizontal)my (margin vertical)m (margin on all sides)In addition to the spacing properties, margin also supports the auto value.
displaynoneblockinline-blockinlineflexinline-flexgridinline-gridoverflowhiddenscrollvisibleautoclipoverflowXhiddenscrollvisibleautoclipoverflowYhiddenscrollvisibleautoclippositionrelativeabsolutefixedstickyzIndex0autocontrol-group-hoveroverlayscrollablecontrol-group-focusembedded-itemsheadermenudropdowninput-embedmodule-fixeddropdown-expandedalerttoastpage-action-barnav-menunavbarmodalmodal-contenttooltipw0fullinheritminW0fullinheritmaxW0fullinherith0fullinheritminH0fullinheritmaxH0fullinheritflexDirectionrowcolumnjustifyContentflex-startflex-endcenterspace-betweenspace-aroundspace-evenlystretchalignItemsflex-startflex-endcenterbaselinestretchflexWrapwrapnowrapflexGrow01flexBasis0autofullflex1autoinitialnonetextAlignleftcenterrighttextDecorationnoneunderlinetextTransformnoneuppercaselowercasecapitalizetextOverflowellipsistruncatetruewhiteSpacenormalnowrapprepre-linepre-wrapbreak-spacesoverflowWrapnormalwordsanywhereverticalAlignbaselinetopmiddlebottomtext-toptext-bottomsubsuperuserSelectnonecursorautodefaultnonecontext-menuhelppointerprogresswaitcellcrosshairtextvertical-textaliascopymoveno-dropnot-allowedgrabgrabbingall-scrollcol-resizerow-resizen-resizee-resizes-resizew-resizene-resizenw-resizese-resizesw-resizeew-resizens-resizenesw-resizenwse-resizezoom-inzoom-outopacity01visuallyHiddentruecenterBaselinetrueinlineas propThe Box component accepts an as prop, which changes what HTML element or component
the box should render as (by default, div).
style propThe Box component accepts a style prop, which allows you to pass in custom styles. This prop should be used instead of the style HTML attribute, since it prevents the styles from being overridden.
Default:'div'
What element or component should be rendered.
style object to be applied to the box