Skip to Content
DocsResourcesShowcase

Spacing

Learn how to customize spacing in Chakra UI

info
Please read the first to learn how to properly customize the styling engine, and get type safety.

Here's an example of how to customize spacing in Chakra UI.

theme.ts

import { createSystem, defaultConfig, defineConfig } from "@chakra-ui/react"

const customConfig = defineConfig({
  theme: {
    tokens: {
      spacing: {
        "128": { value: "32rem" },
        "144": { value: "36rem" },
      },
    },
  },
})

export const system = createSystem(defaultConfig, customConfig)

Here's how to use the custom spacing in Chakra UI.

<Box margin="128" />

Previous

Sizes

Next

Overview