Documentation Index
Fetch the complete documentation index at: https://synapsync.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Spacing Constants
The Nebux Design System provides a comprehensive set of pre-built spacing constants to maintain consistent spacing throughout your application. These constants are implemented asSizedBox widgets for both vertical and horizontal spacing.
Overview
Using consistent spacing is crucial for creating visually harmonious interfaces. Instead of manually creatingSizedBox widgets with hardcoded values, use these pre-defined constants:
Default Padding
The default padding size used across the design system, measured in logical pixels. This value serves as the standard spacing unit.
Vertical Spacing (Height)
All vertical spacing constants areSizedBox widgets with specified height values. Use these between vertically stacked widgets.
Height Space Constants
Default vertical spacing (16 logical pixels).
Extra small vertical spacing (2 logical pixels). Use for very tight layouts.
Minimal vertical spacing (4 logical pixels). Use for tightly grouped elements.
Very small vertical spacing (6 logical pixels).
Small vertical spacing (8 logical pixels). Common for related elements.
Small-medium vertical spacing (10 logical pixels).
Medium-small vertical spacing (12 logical pixels).
Medium vertical spacing (15 logical pixels).
Standard vertical spacing (16 logical pixels). Most commonly used.
Medium-large vertical spacing (20 logical pixels).
Large vertical spacing (24 logical pixels). Use between sections.
Large vertical spacing (25 logical pixels).
Extra large vertical spacing (30 logical pixels).
Extra large vertical spacing (32 logical pixels). Use between major sections.
Very large vertical spacing (40 logical pixels).
Very large vertical spacing (48 logical pixels).
Very large vertical spacing (50 logical pixels).
Extremely large vertical spacing (60 logical pixels).
Extremely large vertical spacing (64 logical pixels).
Massive vertical spacing (80 logical pixels). Use for major layout divisions.
Huge vertical spacing (100 logical pixels). Use for large empty states.
Maximum vertical spacing (200 logical pixels). Use for spacious layouts.
Vertical Spacing Usage Example
Horizontal Spacing (Width)
All horizontal spacing constants areSizedBox widgets with specified width values. Use these between horizontally arranged widgets.
Width Space Constants
Default horizontal spacing (16 logical pixels).
Extra small horizontal spacing (2 logical pixels).
Minimal horizontal spacing (4 logical pixels).
Very small horizontal spacing (6 logical pixels).
Small horizontal spacing (8 logical pixels). Common for icon-text pairs.
Small-medium horizontal spacing (10 logical pixels).
Medium-small horizontal spacing (12 logical pixels).
Medium horizontal spacing (14 logical pixels).
Medium horizontal spacing (15 logical pixels).
Standard horizontal spacing (16 logical pixels). Most commonly used.
Medium-large horizontal spacing (18 logical pixels).
Large horizontal spacing (20 logical pixels).
Extra large horizontal spacing (24 logical pixels).
Extra large horizontal spacing (25 logical pixels).
Very large horizontal spacing (48 logical pixels). Use for widely spaced elements.
Horizontal Spacing Usage Example
Spacing Guidelines
When to Use Each Size
2-6px: Extra Tight
2-6px: Extra Tight
Use for very tightly related elements that should appear as a single unit:
- Between icon and adjacent badge/indicator
- Between chevron and text in compact lists
- Internal chip/tag padding
8-12px: Tight
8-12px: Tight
Use for closely related elements:
- Between icon and text (icon-text pairs)
- Between label and value in key-value pairs
- Between form field and inline helper text
- Between elements in button content
16-20px: Standard
16-20px: Standard
Use for standard element separation:
- Between form fields
- Between list items
- Between card content elements
- Standard padding in containers
24-32px: Loose
24-32px: Loose
Use for grouping and section separation:
- Between form sections
- After section headings
- Between different content groups
- Around major UI elements
40-64px: Very Loose
40-64px: Very Loose
Use for major layout divisions:
- Between major page sections
- Around hero elements
- In spacious marketing layouts
- Before/after call-to-action buttons
80-200px: Extra Loose
80-200px: Extra Loose
Use for dramatic spacing:
- Empty state illustrations
- Landing page sections
- Full-page centered content
- Decorative spacing in marketing pages
Complete Layout Example
Best Practices
Consistency
Always use spacing constants instead of hardcoded values to maintain consistency across your app.
Visual Hierarchy
Use larger spacing between major sections and smaller spacing between related elements to create clear visual hierarchy.
Responsive Design
Consider adjusting spacing for different screen sizes. The constants work well for most mobile devices, but you may want to increase spacing on tablets.
Accessibility
Adequate spacing improves accessibility by making touch targets easier to hit and content easier to read.
Related Documentation
- Layout Guide - Layout patterns and best practices
- Theme System - Overall theming documentation
- Design Tokens - Other design system tokens