Box
A generic container that provides flexible layout with consistent spacing and styling. Use it to apply padding, to nest and group other components, or as the foundation for building structured layouts.
Anchor to propertiesProperties
- Anchor to blockSizeblockSizeSizeUnitsOrAutoDefault: 'auto'
Adjust the block size.
- string
A unique identifier for the element.
- Anchor to inlineSizeinlineSizeSizeUnitsOrAutoDefault: 'auto'
Adjust the inline size.
- Anchor to maxBlockSizemaxBlockSizeSizeUnitsOrNoneDefault: 'none'
Adjust the maximum block size.
- Anchor to maxInlineSizemaxInlineSizeSizeUnitsOrNoneDefault: 'none'
Adjust the maximum inline size.
- Anchor to minBlockSizeminBlockSizeSizeUnitsDefault: '0'
Adjust the minimum block size.
- Anchor to minInlineSizeminInlineSizeSizeUnitsDefault: '0'
Adjust the minimum inline size.
- Anchor to paddingpaddingMaybeAllValuesShorthandProperty<PaddingKeyword>Default: 'none'
Adjust the padding of all edges.
1-to-4-value syntax is supported. Note that, contrary to the CSS, it uses flow-relative values and the order is:
- 4 values:
block-start inline-end block-end inline-start
- 3 values:
block-start inline block-end
- 2 values:
block inline
For example:
large
means block-start, inline-end, block-end and inline-start paddings arelarge
.large none
means block-start and block-end paddings arelarge
, inline-start and inline-end paddings arenone
.large none large
means block-start padding islarge
, inline-end padding isnone
, block-end padding islarge
and inline-start padding isnone
.large none large small
means block-start padding islarge
, inline-end padding isnone
, block-end padding islarge
and inline-start padding issmall
.
A padding value of
auto
will use the default padding for the closest container that has had its usual padding removed.- 4 values:
- Anchor to paddingBlockpaddingBlock'' | MaybeTwoValuesShorthandProperty<PaddingKeyword>Default: '' - meaning no override
Adjust the block-padding.
large none
means block-start padding islarge
, block-end padding isnone
.
This overrides the block value of
padding
.- Anchor to paddingBlockEndpaddingBlockEnd'' | PaddingKeywordDefault: '' - meaning no override
Adjust the block-end padding.
This overrides the block-end value of
.
- Anchor to paddingBlockStartpaddingBlockStart'' | PaddingKeywordDefault: '' - meaning no override
Adjust the block-start padding.
This overrides the block-start value of
.
- Anchor to paddingInlinepaddingInline'' | MaybeTwoValuesShorthandProperty<PaddingKeyword>Default: '' - meaning no override
Adjust the inline padding.
large none
means inline-start padding islarge
, inline-end padding isnone
.
This overrides the inline value of
padding
.- Anchor to paddingInlineEndpaddingInlineEnd'' | PaddingKeywordDefault: '' - meaning no override
Adjust the inline-end padding.
This overrides the inline-end value of
.
- Anchor to paddingInlineStartpaddingInlineStart'' | PaddingKeywordDefault: '' - meaning no override
Adjust the inline-start padding.
This overrides the inline-start value of
.
SizeUnitsOrAuto
SizeUnits | 'auto'
SizeUnits
`${number}px` | `${number}%` | `0`
SizeUnitsOrNone
SizeUnits | 'none'
MaybeAllValuesShorthandProperty
T | `${T} ${T}` | `${T} ${T} ${T}` | `${T} ${T} ${T} ${T}`
PaddingKeyword
SizeKeyword | 'none'
SizeKeyword
'small-500' | 'small-400' | 'small-300' | 'small-200' | 'small-100' | 'small' | 'base' | 'large' | 'large-100' | 'large-200' | 'large-300' | 'large-400' | 'large-500'
MaybeTwoValuesShorthandProperty
T | `${T} ${T}`
Code
Examples
Code
Default
<s-box padding="base"> <s-text>View shipping settings</s-text> </s-box>
Preview
