Responsive Switching
Responsive switching uses a base content.mode and swaps in breakpoint-specific mode and modeConfig overrides from content.responsive.breakpoints. Use it when the same dataset should present differently at desktop, tablet, and mobile widths without duplicating content contracts.
Three breakpoint names are built in and resolved automatically based on window width:
| Name | Applies when |
|---|---|
desktop | window.innerWidth ≥ 1024 px |
tablet | 768 px ≤ window.innerWidth < 1024 px |
mobile | window.innerWidth < 768 px |
Custom breakpoint names are also supported — any key in breakpoints is matched against the current active breakpoint string.
Shared Behavior
Actions, search, filtering, sorting, pagination, and groupings are defined once on zones.content and remain active regardless of which mode is active at the current breakpoint — see the reference pages:
- Content Config: Actions and Interactions
- Content Config: Pagination and Search
- Content Config: Static Filtering and Sorting
- Content Config: Shape for responsive breakpoint contract fields
Core Examples
Each configuration below renders the same data in the mode active at that breakpoint. Resize your browser to see the actual switching behavior in a single config.
Desktop (table)
The default mode at desktop width: a table with header and hover.
Tablet (grid)
Switches to a card grid at tablet width.
Mobile (carousel)
Switches to a carousel at mobile width.
zones: {
content: {
mode: 'table', // desktop default
item: { fields: [...] },
modeConfig: {
table: { showHeader: true, hover: true },
},
responsive: {
breakpoints: {
tablet: {
mode: 'grid',
modeConfig: {
grid: { minItemWidth: '260px', gap: '0.75rem' },
},
},
mobile: {
mode: 'carousel',
modeConfig: {
carousel: { itemWidth: 260, showIndicators: true },
},
},
},
},
},
}
Responsive Options Reference
| Option | Values | Default | Effect |
|---|---|---|---|
content.mode | any mode name | required | Sets the default mode used at desktop width (and any width with no matching breakpoint override). |
content.responsive.breakpoints | Record<string, { mode?, modeConfig? }> | unset | Declares width-specific overrides keyed by breakpoint name. |
breakpoints.<name>.mode | any mode name | unset | Switches to a different mode at that breakpoint. |
breakpoints.<name>.modeConfig | partial ModeConfig | unset | Overrides the chosen mode's config at that breakpoint. Spread-merged on top of the base modeConfig. |
Mode-Specific Caveats
tablemode is automatically demoted togridon mobile (window.innerWidth < 768) even if nomobilebreakpoint override is configured. This is a built-in safety fallback since table layout does not work well at narrow widths.breakpoints.<name>.modeConfigis spread-merged on top of the basecontent.modeConfig, not replaced entirely. Only the keys you provide are overridden.- Each breakpoint
modeConfigshould match the mode selected at that breakpoint. - Shared contracts (actions, search, filtering, sorting, pagination) come from
zones.contentand apply across all breakpoints.
Coverage Summary
Every responsive switching option is represented by at least one example or subsection on this page:
content.mode: Desktop (table)content.responsive.breakpoints: full config snippetbreakpoints.<name>.mode: Tablet (grid), Mobile (carousel)breakpoints.<name>.modeConfig: Tablet (grid), Mobile (carousel)