Grid

A CSS grid container. Sets the column count per breakpoint (sm, md, lg) and the gap from the spacing token scale.

Usage

<script>
  import { Grid } from '@vultra/ui';
</script>

<Grid cols={1} sm={2} lg={4} gap={4}>
  <div>Cell</div>
  <div>Cell</div>
  <div>Cell</div>
  <div>Cell</div>
</Grid>

Props

PropTypeDefaultDescription
cols1 \| 2 \| 3 \| 4 \| 5 \| 61Base column count
sm2 \| 3 \| 4 \| 5 \| 6Columns at the sm breakpoint
md2 \| 3 \| 4 \| 5 \| 6Columns at the md breakpoint
lg2 \| 3 \| 4 \| 5 \| 6Columns at the lg breakpoint
gapnumber4Gap from the spacing token scale
classstringAdditional CSS classes
childrenSnippetGrid content

Features

  • Responsive column counts per breakpoint without utility soup.
  • Gap restricted to the spacing token scale.
  • Works with any children; cells size automatically.