Socra UI
Spacing
Layout / Spacing

Spacing

Spacing in the Socra UI system.

Library Status

Built
@socra/theme

@socra/theme exposes theme.spacing(n).

Live Showcase

StateTheme pathRule
Default

theme.palette.text.primary

Clear, enabled, and ready.

Hover

theme.palette.action.hover

Pointer feedback only.

Selected

theme.palette.action.selected

Persistent chosen state.

Loading

theme.palette.action.disabledBackground

Show honest work underway.

Disabled

theme.palette.action.disabled

Unavailable until the cause is resolved.

Theme References

Spacing scale
spacing
theme.spacing(n)Live value: Resolved by recipe

All gaps, insets, and rhythm.

Component radius
shape
theme.shape.borderRadiusLive value: 12

Default component shape.

Breakpoint values
breakpoint
theme.breakpoints.values.*Live value: Resolved by recipe

Responsive layout decisions.

Resolved from the active mode

Live Theme Catalog

These are theme references and component recipes by name. Toggle dark mode to verify the same names resolve to the active theme.

Structure

Spacing, shape, and breakpoint references that define layout rhythm, card shape, and responsive behavior.

3 references
Spacing scale
spacing
theme.spacing(n)Live value: Resolved by recipe

All gaps, insets, and rhythm.

Component radius
shape
theme.shape.borderRadiusLive value: 12

Default component shape.

Breakpoint values
breakpoint
theme.breakpoints.values.*Live value: Resolved by recipe

Responsive layout decisions.

Usage Contract

Use Spacing through the shared Socra UI stack so every product stays standardized.

Shared implementation exists in the current UI/theme libraries.


Every visible value comes from @socra/theme or a themed MUI primitive.


The page becomes complete only when the live state matrix and copy-paste recipe are real.

Do

Use the shared primitive first.

The system improves once and every product inherits the fix.

Name the user job before the component.

A component earns a place only when it helps the user decide, act, recover, or understand.

Promote missing behavior into the library.

Local UI creates drift; library contracts create standardization.

Do not

Do not build a product-local replacement.

A local primitive splits behavior and future migrations.

Do not copy theme values.

Values live in @socra/theme and are consumed by name.

Do not add decoration as a substitute for structure.

If the hierarchy is weak, fix the hierarchy.

Copy-Paste Code

Spacing recipe

<Stack spacing={2}>
  <LazyLiveExample kind="Spacing" />
</Stack>