Axonyx UI

Layout primitive

Spacer

Add one deliberate vertical gap using a Foundry spacing token. Use Stack gap when every item needs the same rhythm.

Next: Stack

Compare 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
Code
asx
<Box padding="sm" surface="inset">First panel</Box>
<Spacer size="lg" />
<Box padding="sm" surface="inset">Second panel</Box>

Installation

Command
bash
cargo ax add ui
Manual setup
Cargo.toml
toml
[dependencies]
axonyx-ui = "0.0.80"
app/layout.asx
asx
use "@axonyx/ui"

Spacer contract

Import
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.