Introduction
Spacing, often referred to as whitespace, is the intentional distance between elements on a screen. Thoughtful use of spacing declutters layouts, groups related content, and establishes a clear visual hierarchy. By guiding focus to what matters most, effective spacing enhances usability and reduces cognitive load for fans.
Principles
Space carries meaning. The gap between two things is the clearest signal a fan gets about whether they belong together. Less space to join them, more to separate them. Never the same gap for both.
Relationships, not pixels. Work out how two things relate, then use the value for that relationship. Don’t pick a number because it happens to look right on one screen.
8px Base Grid
Our spacing system is built on an 8px grid, providing a consistent foundation for layout and design. This scalable approach ensures harmony across components and interfaces, making it easy to align elements and maintain visual balance. By adhering to this grid, we create predictable and cohesive experiences that are both functional and aesthetically pleasing.
Spacing Tokens
In Flutter, each token is Spacing.s followed by the step number, so $space-025 is Spacing.s025 and $space-600 is Spacing.s600.
Example
Usage
Component Spacing
Component spacing refers to the arrangement and distance between individual elements within a user interface (UI) component, such as buttons, form fields, or cards. Thoughtful spacing ensures visual balance, usability, and clarity, making components intuitive and aesthetically pleasing.
Key considerations for component spacing include:
Margins: Margins define the space between the component’s outer edges and adjacent elements or layout boundaries. Proper margin values prevent components from feeling cramped, providing clear visual separation and maintaining a harmonious layout.
Padding: Padding is the space between a component’s content or interactive elements and its outer boundaries. Adequate padding gives the content breathing room, improves readability, and ensures that interactive elements are easy to engage with.
Internal Spacing: Internal spacing manages the distance between elements within a component, such as text, buttons, icons, or images. Proper internal spacing ensures these elements are visually distinct, preventing clutter and enhancing usability.
Proportions: Consistent proportions within a component are crucial for a polished design. For instance, the spacing between a button’s text and its edges should feel balanced to avoid unevenness. Maintaining proportional relationships creates cohesive, professional components.
Effective component spacing enhances both the functionality and appearance of UI elements, contributing to a seamless fan experience.
Section Spacing
For a cohesive experience across mobile apps, consistent values should be applied between components and sections.
Spacing between distinct components within an enclosed section
should use $space-200 (16px).
Space between sections themselves will use $space-300 (24px).
Space between a section title and it’s related content below will use $space-150 (12px).