Grid component is used to create a responsive layout grid that adapts to screen size and orientation, ensuring consistency across layouts. The component is based on a 12-column grid layout.
import { Grid } from "@deca-ui/react"
Using breakpoints on Grid.Container applies it to all Grid children components
import {styled} from "@deca-ui/react"
const MockItem = styled("div", {
bg: "$primary",
p: "$3",
color: "$white",
br: "$md"
})
<Grid.Container n={12} xs={6}>
<Grid>
<MockItem>Item 1</MockItem>
</Grid>
<Grid>
<MockItem>Item 2</MockItem>
</Grid>
</Grid.Container>
Grid components can have individual breakpoints that override the given breakpoints of Grid.Container
import {styled} from "@deca-ui/react"
const MockItem = styled("div", {
bg: "$primary",
p: "$3",
color: "$white",
br: "$md"
})
<Grid.Container n={12}>
<Grid>
<MockItem xs={4}>Item 1</MockItem>
</Grid>
<Grid>
<MockItem xs={8}>Item 2</MockItem>
</Grid>
<Grid>
<MockItem xs={8}>Item 3</MockItem>
</Grid>
<Grid>
<MockItem xs={4}>Item 4</MockItem>
</Grid>
</Grid.Container>
Made by Heril Saha