Skip to main content

Configure the following properties on the Box component.

Anchor to blockSize
blockSize
Default: 'auto'

The block size of the container. Auto automatically sizes based on the container's children.

string

A unique identifier for the element used for targeting with CSS or JavaScript.

Anchor to inlineSize
inlineSize
Default: 'auto'

The inline size of the container. Auto automatically sizes based on the container's children.

Anchor to maxBlockSize
maxBlockSize
Default: 'none'

The maximum block size constraint for the container.

Anchor to maxInlineSize
maxInlineSize
Default: 'none'

The maximum inline size constraint for the container.

Anchor to minBlockSize
minBlockSize
Default: '0'

The minimum block size constraint for the container.

Anchor to minInlineSize
minInlineSize
Default: '0'

The minimum inline size constraint for the container.

Anchor to padding
padding
<>
Default: 'none'

The padding applied to all edges of the container. Supports 1-to-4-value syntax using flow-relative values in the order:

  • 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 are large.
  • large none means block-start and block-end paddings are large, inline-start and inline-end paddings are none.
  • large none large means block-start padding is large, inline-end padding is none, block-end padding is large and inline-start padding is none.
  • large none large small means block-start padding is large, inline-end padding is none, block-end padding is large and inline-start padding is small.

An auto value inherits the default padding from the closest container that has removed its usual padding.

Anchor to paddingBlock
paddingBlock
'' | <>
Default: '' - meaning no override

The block-axis padding for the container. Overrides the block value of the padding property.

Anchor to paddingBlockEnd
paddingBlockEnd
'' |
Default: '' - meaning no override

The block-end padding for the container. Overrides the block-end value of the paddingBlock property.

Anchor to paddingBlockStart
paddingBlockStart
'' |
Default: '' - meaning no override

The block-start padding for the container. Overrides the block-start value of the paddingBlock property.

Anchor to paddingInline
paddingInline
'' | <>
Default: '' - meaning no override

The inline-axis padding for the container. Supports two-value syntax where large none sets inline-start to large and inline-end to none. Overrides the inline value of the padding property.

Anchor to paddingInlineEnd
paddingInlineEnd
'' |
Default: '' - meaning no override

The inline-end padding for the container. Overrides the inline-end value of the paddingInline property.

Anchor to paddingInlineStart
paddingInlineStart
'' |
Default: '' - meaning no override

The inline-start padding for the container. Overrides the inline-start value of the paddingInline property.


Anchor to Create a container with a boxCreate a container with a box

Create layouts using a box component. This example demonstrates a basic box container with padding and styling.

Create a container with a box

Create layouts using a box component. This example demonstrates a basic box container with padding and styling.

Create a container with a box

<s-box padding="base">
<s-text>View shipping settings</s-text>
</s-box>

  • Use semantic sizing: Choose auto to adapt to content, percentages for responsive layouts, pixels only for exact dimensions.
  • Use design system padding: Use predefined padding keywords (small, base, large) for consistency.
  • Use directional padding for asymmetry: Use paddingInline and paddingBlock when different spacing is needed on different sides.
  • Understand block vs inline: block refers to content flow direction (usually vertical), inline to text direction (usually horizontal).

Was this page helpful?