Flex Grid
FlexGrid
uses Flexbox to create a multi-column layout.
-->
FlexGrid
uses Flexbox to create a multi-column layout.
FlexGrid
automatically expands leftover items so they don’t feel like orphans.
FlexGrid
lets you center leftover items instead of expanding them. This can be amazing for presentation when building landing pages or dashboards
Each child in FlexGrid
can also span multiple columns. Use this to create any layout you wish.
FlexGrid
lets you determine the minimum width of each item. Once defined, FlexGrid
does the rest and creates a responsive layout for you.
FlexGrid
lets you create grid layouts with Flexbox. You can use this over SimpleGrid
in these situations:
FlexGrid
s API is similar to SimpleGrid
. You can define the number of columns in FlexGrid
with --cols
.
If there are not enough items in the row, FlexGrid
automatically expands each item with flex-grow
.
If you want to center the last row instead of expanding them, you can set --grow
to 0
. Once you do this, you can use the justify-center
to center the items.
You can span an item across multiple columns with the --span
property.
You can change the gap
between items with the --gap
variable. The gap
property will not work.
FlexGrid
places items in a new row when the size of the item hits the value stated in --item-width
.
If you don’t wish to use --item-width
, you can still create manual breakpoints via --cols
and Tailwind responsive modifiers.
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.
FlexGrid
lets you create grid layouts with Flexbox. You can use this over SimpleGrid
in these situations:
FlexGrid
s API is similar to SimpleGrid
. You can define the number of columns in FlexGrid
with --cols
.
If there are not enough items in the row, FlexGrid
automatically expands each item with flex-grow
.
If you want to center the last row instead of expanding them, you can set --grow
to 0
. Once you do this, you can use the justify-center
to center the items.
You can span an item across multiple columns with the --span
property.
You can change the gap
between items with the --gap
variable. The gap
property will not work.
FlexGrid
places items in a new row when the size of the item hits the value stated in --item-width
.
If you don’t wish to use --item-width
, you can still create manual breakpoints via --cols
and Tailwind responsive modifiers.
Here’s the CSS for FlexGrid
.
The astro-island
and astro-slot
selectors help to alleviate styling frustrations when using Astro.
Psst: This montrosity took an incredible amount of trial and error to make. 🫠
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 FlexGrid
.
The astro-island
and astro-slot
selectors help to alleviate styling frustrations when using Astro.
Psst: This montrosity took an incredible amount of trial and error to make. 🫠
CSS Variable | Default | Description |
---|---|---|
--gap | 1rem | Gap between columns |
--cols | 1 | Number of columns |
--item-width | 1 | Minimum width of each item. |
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 |
--item-width | 1 | Minimum width of each item. |
CSS Variable | Default | Description |
---|---|---|
--span | 1 | Number of columns that the child should occupy. |