F
Filament3mo ago
Keika

Spatie MediaLibrary images columns

can I somehow manage the number of columns the images in the MediaLibrary plugin take? Now the images that the full row, but I would like, for example, 3 images per row. Can i manage that with PHP or do I need to use CSS? Thanks
7 Replies
Keika
KeikaOP3mo ago
nobody?
ChesterS
ChesterS3mo ago
If you're talking about the upload field - you can do that with CSS afaik
Keika
KeikaOP3mo ago
not that. The actual visual of the drag/drop. As a base, we only have 1 image per row. I would like 3 for example thought so too. I did go through the docs and code, but couldn't find anything
dissto
dissto3mo ago
Keika
KeikaOP3mo ago
yes I do thanks for that
Shani Jahania
Shani Jahania3mo ago
Hi @Keika I am using below css to convert images to grid style.
.upload-media-gallery .filepond--item {
width: calc(25% - 10px);
margin: 5px !important;
min-height: 140px;
}

/* Mobile responsive - 2 items per row */
@media (max-width: 768px) {
.upload-media-gallery .filepond--item {
width: calc(50% - 10px);
min-height: 120px;
}
}
.upload-media-gallery .filepond--item {
width: calc(25% - 10px);
margin: 5px !important;
min-height: 140px;
}

/* Mobile responsive - 2 items per row */
@media (max-width: 768px) {
.upload-media-gallery .filepond--item {
width: calc(50% - 10px);
min-height: 120px;
}
}

Did you find this page helpful?