Gallery Grid
GalleryGrid
creates a gallery with CSS Grid. You can use auto-fill
or auto-fit
to size the columns.
-->
GalleryGrid
creates a gallery with CSS Grid. You can use auto-fill
or auto-fit
to size the columns.
GalleryGrid
lets you create a Gallery with CSS grid. It uses auto-fill
by default.
You can change to auto-fit
easily by using the Gallery-fit
class. This makes each column expand to fill the available space.
You can size each column with --item-width
.
All grid items have a max-width
of 100%
, so you can set --item-width
to your heart’s content without worrying about it being too large.
You can create a Gallery that uses auto-fill
with GalleryGrid
.
If you wish to be more explicit, you can create the same grid with GalleryGrid-fll
.
If you want your columns to expand and fit the available space, you can use GalleryGrid-fit
.
You can change the width of each Gallery column with the --item-width
variable. All grid items already have a max-width
of 100%
so you never have to worry the size of grid items exceeding the size of the container
If you wish for grid items to span multiple colums, you can use the span
variable.
You can change the gap between items with the gap
property or the --gap
variable.
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.
You can create a Gallery that uses auto-fill
with GalleryGrid
.
If you wish to be more explicit, you can create the same grid with GalleryGrid-fll
.
If you want your columns to expand and fit the available space, you can use GalleryGrid-fit
.
You can change the width of each Gallery column with the --item-width
variable. All grid items already have a max-width
of 100%
so you never have to worry the size of grid items exceeding the size of the container
If you wish for grid items to span multiple colums, you can use the span
variable.
You can change the gap between items with the gap
property or the --gap
variable.
Here’s the CSS for GalleryGrid
.
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 GalleryGrid
.
The astro-island
and astro-slot
selectors help to alleviate styling frustrations when using Astro.
CSS Variable | Default | Description |
---|---|---|
--item-width | 3rem | Size of each column |
--fit | auto-fill | Size colums with auto-fit or auto-fill |
--gap | 1rem | Gap between columns |
Here’s the difference between auto-fill
and auto-fit
:
auto-fill
: Fills the row with as many columns as possible by creating new columns.auto-fit
: Fits the currently available columns into the
given space by stretching each column.Class | Description |
---|---|
GalleryGrid-fit | Uses auto-fit |
GalleryGrid-fill | Uses auto-fill |
CSS Variable | Default | Description |
---|---|---|
--span | 1 | Number of columns to span |
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 |
---|---|---|
--item-width | 3rem | Size of each column |
--fit | auto-fill | Size colums with auto-fit or auto-fill |
--gap | 1rem | Gap between columns |
Here’s the difference between auto-fill
and auto-fit
:
auto-fill
: Fills the row with as many columns as possible by creating new columns.auto-fit
: Fits the currently available columns into the
given space by stretching each column.Class | Description |
---|---|
GalleryGrid-fit | Uses auto-fit |
GalleryGrid-fill | Uses auto-fill |
CSS Variable | Default | Description |
---|---|---|
--span | 1 | Number of columns to span |