Spacing

Mocha's spacing scale, rendered by Mocha. Padding, margins and gaps use its names, like p-sm or gap-lg, never numbers. Space things out with Stack and Inline.

Scale

Preview
scale.tsx
import { Inline } from "~/components/ui/inline"
import { spaceSteps, Stack } from "~/components/ui/stack"
import { Text } from "~/components/ui/text"

export default function Example() {
  return (
    <Stack gap="sm" className="w-full">
      {spaceSteps.map((step) => (
        <Inline key={step} gap="xl" wrap={false}>
          <Text render={<span />} size="xs" family="mono" tone="muted" className="w-10">
            {step}
          </Text>
          <Inline gap={step} wrap={false} aria-hidden="true">
            <span className="size-4 bg-primary" />
            <span className="size-4 bg-primary" />
          </Inline>
        </Inline>
      ))}
    </Stack>
  )
}

Steps

The --space-* tokens in Mocha's theme, which the names map to.

StepValue
3xs0.125rem
2xs0.25rem
xs0.375rem
sm0.5rem
md0.75rem
lg1rem
xl1.5rem
2xl2rem
3xl3rem
4xl4rem