# Gap
The Gap system provides consistent spacing between elements using CSS gap property. It offers predefined sizes, responsive spacing, and custom values to maintain visual rhythm throughout your interface.
### Size Variants
The gap system includes predefined base sizes and arbitrary pixel values. These standardized spaces
help maintain consistent spacing across your application's grid and flex layouts.
#### Base
The base `gap` class without size modifiers
and the `gap--base` class both produce the same visual result,
providing the standard spacing. Use `gap--base` when you need
to explicitly set the base size in responsive contexts. See the [Responsive Gaps](#responsive-gap) section for examples.
gap--none
gap--none
gap--none
gap--xsmall
gap--xsmall
gap--xsmall
gap--small
gap--small
gap--small
gap
gap
gap
gap--medium
gap--medium
gap--medium
gap--large
gap--large
gap--large
gap--xlarge
gap--xlarge
gap--xlarge
gap--xxlarge
gap--xxlarge
gap--xxlarge
Predefined GapsDesign System
...
...
...
...
...
...
...
...
...
#### Arbitrary
Use `gap--[Npx]` syntax to specify
exact pixel values from **0px to 50px**. This works with both grid and flex layouts, but does not support responsive variants.
gap--[0px]
gap--[0px]
gap--[0px]
gap--[10px]
gap--[10px]
gap--[10px]
gap--[30px]
gap--[30px]
gap--[30px]
gap--[50px]
gap--[50px]
gap--[50px]
Arbitrary Pixel GapsDesign System
...
...
...
...
...
Arbitrary gap values using the `gap--[Npx]` syntax do not support responsive variants. Use predefined gap classes if you need responsive behavior.
### Distribution Modifiers
Beyond fixed gaps, you can use special modifiers to control how space is distributed between elements.
These modifiers are particularly useful for creating flexible, dynamic layouts.
#### Auto Distribution
The `gap--auto` modifier
distributes available space evenly between elements, including equal spacing at the edges.
This uses `justify-content: space-evenly`.
gap--auto
gap--auto
gap--auto
Auto Distribution GapDesign System
#### Distribute
The `gap--distribute` modifier
places the first item at the start of the container and the last item at the end, with equal spacing between items.
This uses `justify-content: space-between`.
gap--distribute
gap--distribute
gap--distribute
Distribute GapDesign System
First item (at start)
Middle item
Last item (at end)
#### Legacy: Space Between
The `gap--space-between` modifier
is maintained for backwards compatibility. It behaves the same as `gap--auto`,
using `justify-content: space-evenly`.
For the actual `space-between` behavior, use `gap--distribute`.
### Responsive Gaps
Gap utilities support size-based breakpoints, orientation variants, and their combination.
Use prefixes like `md:`, `portrait:`,
and `md:portrait:` to target conditions.
#### Responsive Gap Examples
Apply different gap values at different breakpoints using the size-based responsive system.
The framework follows a mobile-first approach where larger breakpoints inherit smaller ones.
The `--base` modifier
is particularly useful for resetting to the default size at specific breakpoints.
Responsive Gap
Responsive Gap
Responsive Gap
Small by default, large on md+, xlarge on lg+, medium gap in portrait, xlarge in md+ portrait
Responsive GapsSize-Based
...
...
Gap utilities only support size-based responsive variants. Bit-depth variants (like `1bit:` or `4bit:`) are not available for gap classes.
Previous
[Spacing Control element spacing with fixed margin and padding values](/framework/docs/spacing)
Next
[Flex Arrange elements with flexible layouts and alignment options](/framework/docs/flex)