Skip to content
MyAppBuilder
StableGuide

Spacing and corner radius

Two theme settings control the "feel" of your layouts more than any other: density (how much space components get) and corner radius (how rounded cards, buttons and inputs are). Both live under Theme › Shape & spacing and apply to every component at once.

Two theme settings control the "feel" of your layouts more than any other: density (how much space components get) and corner radius (how rounded cards, buttons and inputs are). Both live under Theme › Shape & spacing and apply to every component at once.

When to use

  • A back-office tool with many tables: Compact density, small radius.
  • A customer portal or booking page: Spacious density, larger radius.
  • Matching a brand that is either sharp and corporate or soft and friendly.

Density

Density sets the default gap between components in a grid or row and the default padding inside cards, sections and dialogs:

DensityGapPadding
Compact10 px14 px
Comfortable (default)16 px18 px
Spacious24 px24 px
Example
Compact                     Spacious
[Card][Card][Card]          [ Card ]   [ Card ]   [ Card ]
[Card][Card][Card]
                            [ Card ]   [ Card ]   [ Card ]

Containers can still set their own Gap (px) and Padding in the Layout tab; empty values follow the theme.

Corner radius

The Corner radius slider (0–24 px) sets the medium radius used by cards, inputs and buttons. The small radius (chips, small controls) and the large radius (dialogs, big cards) follow automatically: small is about 60 % of the value and large about 140 %.

SliderSmallMediumLarge
0000
10 (default)61014
16101622

Presets use different radii: Mono is 4 px (sharp), Ocean 8, Classic 10, Forest 12, Sunset 14.

How to change them

  1. Open Theme › Shape & spacing.
  2. Drag Corner radius; the live preview follows the slider and the value is saved when you release.
  3. Choose Density: Compact, Comfortable or Spacious.
  4. Undo with Ctrl+Z if you do not like the result.

You can also ask the AI: "Make it more compact", "Make the spacing more spacious", "Use rounded corners" (sets 16 px) or "Use square corners" (sets 2 px).

Per-component spacing

For one component, the Layout tab has Padding and Margin fields. Enter 1 value (all sides), 2 values (vertical horizontal) or 4 values (top right bottom left), in pixels, for example 12 24. The Responsive tab lets you change Padding and Margin for a single breakpoint; by default the page root already uses a smaller padding (14 px) on mobile than on desktop (24 px). The Style tab's Radius field overrides the corner radius of one component.

Common mistakes

  • Fixing spacing on every component instead of changing density. One theme change beats fifty padding edits.
  • Radius larger than the component. A 24 px radius on a 28 px tall chip looks like a pill; that may be what you want, but check small controls in the preview.
  • Confusing gap with padding. Gap is the space between children; padding is the space inside a container's edges.

Advanced

Tokens: spacing.density (compact | comfortable | spacious), spacing.unit (2–16, reserved for spacing calculations), radii.sm, radii.md, radii.lg (sm and md 0–40, lg 0–60). The Theme view writes all three radii from the slider (radiusTokens()); the AI's set_theme_token for radii.md sets only the medium value. CSS variables: --mab-gap, --mab-pad, --mab-radius-sm, --mab-radius, --mab-radius-lg.

Related

Was this helpful?