Array-Based Syntax
Provide an array of values that map to breakpoints:Breakpoints
Define breakpoints in your theme:Custom Breakpoints
You can use any CSS length unit:Mobile-First Approach
The first value in the array is the base (mobile) style. Each subsequent value applies at the corresponding breakpoint:100%- Mobile (default)50%- Tablet and up (≥ 40em)33.333%- Desktop and up (≥ 52em)25%- Large desktop (≥ 64em)
Responsive Implementation
Here’s how Theme UI transforms responsive arrays (from the source code):Skipping Breakpoints
Usenull or undefined to skip a breakpoint:
100%at mobile- No change at first breakpoint
50%at second breakpoint
Multiple Responsive Properties
Combine multiple responsive properties:Responsive Typography
Responsive Layout
Create responsive layouts:Responsive Spacing
Nested Responsive Styles
Responsive arrays work in nested objects:Responsive Variants
Combine responsive arrays with variants:Working with Grid and Flexbox
Responsive Flexbox
Responsive Grid
Responsive Display
Show/hide elements at different breakpoints:TypeScript Support
Responsive arrays are fully typed:Best Practices
Start Mobile-First
Always define the mobile style first:Use Consistent Breakpoints
Define breakpoints that match your design system:Combine with Theme Scales
Use theme values in responsive arrays:Real-World Example
A complete responsive card component:Responsive arrays provide a concise, mobile-first way to create responsive designs without writing media queries manually.
