Breakpoint Tokens
Chromia UI includes four breakpoint sizes that follow common device dimensions:| Breakpoint | Range | Constant |
|---|---|---|
| Mobile | 0-599px | BreakpointTokens.mobile (600) |
| Tablet | 600-1023px | BreakpointTokens.tablet (1024) |
| Desktop | 1024-1439px | BreakpointTokens.desktop (1440) |
| Large Desktop | 1440px+ | BreakpointTokens.desktopLarge (1920) |
Getting the Current Breakpoint
Using BuildContext Extension
The easiest way to get the current breakpoint is using theBuildContext extension:
Available Extension Methods
Using BreakpointTokens Directly
ResponsiveBuilder Widget
TheResponsiveBuilder widget makes it easy to show different layouts based on the current breakpoint:
Fallback Behavior
If you don’t provide a widget for a specific breakpoint,ResponsiveBuilder will fall back to the next smaller size:
Responsive Patterns
Complete Example
Here’s a complete example showing a responsive dashboard:Best Practices
Use BuildContext extensions for cleaner code
Use BuildContext extensions for cleaner code
Instead of:Use:
Combine with design tokens
Combine with design tokens
Use breakpoints together with spacing, typography, and other design tokens:
Test on multiple screen sizes
Test on multiple screen sizes
Always test your responsive layouts on:
- Mobile phones (portrait and landscape)
- Tablets (portrait and landscape)
- Desktop screens (standard and large)
Use ResponsiveBuilder for major layout changes
Use ResponsiveBuilder for major layout changes
When layouts are significantly different across breakpoints, use
ResponsiveBuilder instead of conditional logic.Related Resources
Spacing System
Learn about consistent spacing tokens
Component Layout
See how components adapt responsively
