Simple Grid
SimpleGrid
uses CSS Grid to create customizable grids. Use --cols
to change the number of columns created by SimpleGrid
.
-->
SimpleGrid
uses CSS Grid to create customizable grids. Use --cols
to change the number of columns created by SimpleGrid
.
Create flexible grids with ease. Just use the [--cols]
variable to specify the number of columns you want.
Just change the --span
variable to change the number of columns a child spans. All children span 1 column by default.
If the child exceeds the number of columns, it will automatically flow to the next row.
Use dense
if you wish to fill up spaces with smaller items that come afterwards.
You can use Tailwind responsive modifiers to update --cols
and --span
on the fly to make any responsive grid you want!
CSS Grids are notorious to get right because you need minmax(0, <insert-value-here>)
or your grid items will overflow.
No such nonsesne here. SimpleGrid
takes care of this for you.
Using SimpleGrid
is easy. Just use [--cols]
to specify the number of columns you want for your grid!
If you don’t want to use Tailwind, you can still use --cols
directly as an inline style, but you won’t be able to make easy responsive grids with SimpleGrid
.
Change the gap between grid items with the gap
property or the --gap
variable.
Grid items can span multiple columns by using the --span
variable. The default value is 1
.
You can use dense
to make the grid items fill in the empty spaces left by larger grid items.
SimpleGrid
lets you change the number of columns easily with Tailwind responsive modifiers. Resize the following demo to see this in action!
You can also change --span
in addition to changing --cols
. Below is an example where we change --span
and kept --cols
the same.
When using Grids, you may find that you need to order content such that:
This can be done easily by using Tailwind’s order
class on each grid item.
Splendid Labz is free because we love developers and we want to contribute back to the ecosystem.
We only charge for access to the documentation to keep the project going. If you don't wish to pay, feel free to use the content from the features tab, our blogs or our videos as your guide.
Using SimpleGrid
is easy. Just use [--cols]
to specify the number of columns you want for your grid!
If you don’t want to use Tailwind, you can still use --cols
directly as an inline style, but you won’t be able to make easy responsive grids with SimpleGrid
.
Change the gap between grid items with the gap
property or the --gap
variable.
Grid items can span multiple columns by using the --span
variable. The default value is 1
.
You can use dense
to make the grid items fill in the empty spaces left by larger grid items.
SimpleGrid
lets you change the number of columns easily with Tailwind responsive modifiers. Resize the following demo to see this in action!
You can also change --span
in addition to changing --cols
. Below is an example where we change --span
and kept --cols
the same.
When using Grids, you may find that you need to order content such that:
This can be done easily by using Tailwind’s order
class on each grid item.
Here’s the CSS for SimpleGrid
.
The astro-island
and astro-slot
selectors help to alleviate styling frustrations when using Astro.
Splendid Labz is free because we love developers and we want to contribute back to the ecosystem.
We only charge for access to the documentation to keep the project going. If you don't wish to pay, feel free to use the content from the features tab, our blogs or our videos as your guide.
Here’s the CSS for SimpleGrid
.
The astro-island
and astro-slot
selectors help to alleviate styling frustrations when using Astro.
CSS Variable | Default | Description |
---|---|---|
--gap | 1rem | Gap between columns |
--cols | 1 | Number of columns |
CSS Variable | Default | Description |
---|---|---|
--span | 1 | Number of columns that the child should occupy. |
Splendid Labz is free because we love developers and we want to contribute back to the ecosystem.
We only charge for access to the documentation to keep the project going. If you don't wish to pay, feel free to use the content from the features tab, our blogs or our videos as your guide.
CSS Variable | Default | Description |
---|---|---|
--gap | 1rem | Gap between columns |
--cols | 1 | Number of columns |
CSS Variable | Default | Description |
---|---|---|
--span | 1 | Number of columns that the child should occupy. |