Responsive breakpoints
Adapt layout and visibility with breakpoint-aware values instead of duplicating component markup.
Breakpoint vocabulary
Use the theme breakpoints as named design decisions. base is the default layout, and each named breakpoint applies from its minimum width upward.
smstarts at 40rem andmdstarts at 48rem.lgstarts at 64rem,xlat 80rem, and2xlat 96rem.- Theme configuration can provide a different ordered breakpoint scale.
baseDefault layout; no media query.
sm@media screen and (min-width: 40rem)
md@media screen and (min-width: 48rem)
lg@media screen and (min-width: 64rem)
xl@media screen and (min-width: 80rem)
2xl@media screen and (min-width: 96rem)
Responsive values
Most layout props accept sparse responsive objects and arrays. Prefer an object in guides and application code because the named breakpoint makes the intent clear.
Overview
Activity
import { Box, Grid, GridItem, Text } from "@smoothie-framework/whisk-react";
<Grid columns={{ base: 1, md: 2 }} gap={{ base: 3, md: 5 }}>
<GridItem>
<Box background="surface2" rounded="lg" padding={4}>
<Text>Overview</Text>
</Box>
</GridItem>
<GridItem>
<Box background="surface2" rounded="lg" padding={4}>
<Text>Activity</Text>
</Box>
</GridItem>
</Grid>Arrays follow the configured breakpoint order: base, sm, md, lg, xl, and 2xl. Use an explicit undefined entry to skip a breakpoint; prefer objects when the named breakpoint makes the intent easier to review.
Array values apply at base, then md.
import { Box, Text } from "@smoothie-framework/whisk-react";
<Box width={["full", undefined, "prose"]} background="surface2" rounded="lg" padding={[3, undefined, 5]}>
<Text>Array values apply at base, then md.</Text>
</Box>Responsive conditions
Use visibility helpers such as hideFrom and hideBelow when content should be intentionally present only in a range. Use them for an equivalent alternative or nonessential content, not to remove unique information or change a heading hierarchy.
import { Button, StackRow } from "@smoothie-framework/whisk-react";
<StackRow gap={3}>
<Button hideBelow="md">Desktop action</Button>
<Button hideFrom="md" variant="secondary">Compact action</Button>
</StackRow>Responsive objects accept breakpoint keys such as md, plus range keys such as baseOnly, mdOnly, mdDown, andlgToXl. These are values inside a responsive prop, not component props.