Layout primitive
Spacer
Add one deliberate vertical gap using a Foundry spacing token. Use Stack gap when every item needs the same rhythm.
Next: StackCompare spacing tokens
Each pair of panels is separated only by Spacer. The wrapper Grid controls columns, while Spacer controls the vertical gap inside each column.
sm
Small gap
md
Default gap
2xl
Large gap
View code
asx
<Box padding="sm" surface="inset">First panel</Box>
<Spacer size="lg" />
<Box padding="sm" surface="inset">Second panel</Box>Installation
bash
cargo ax add uiManual setup
toml
[dependencies]
axonyx-ui = "0.0.80"asx
use "@axonyx/ui"Spacer contract
asx
import { Spacer } from "@axonyx/ui/foundry/Spacer.asx"size: String, default md. Supported values are sm, md, lg, xl, and 2xl. Heights come from --ax-space-sm through --ax-space-2xl and follow theme token overrides.
Spacer renders an empty block-level span and accepts no content slot. It creates vertical space; it does not grow to fill a toolbar or provide horizontal spacing.
For repeated vertical spacing use Stack gap. For rows use Flex or Cluster gap. Reserve Spacer for an isolated gap inside ordinary block content.