F
Filamentβ€’2mo ago
slamx_

Add class to Layout Grid

Is it possible to add a class to the Grid Layout Component?
7 Replies
Tally
Tallyβ€’2mo ago
Yes, try this πŸ™‚
->extraAttributes(['class' => 'yourclass'])
->extraAttributes(['class' => 'yourclass'])
on your Grid Component
slamx_
slamx_β€’2mo ago
But this adds a class or a extra wrapper before the Grid is rendered, is it possible to add a class to the main grid div?
Tally
Tallyβ€’2mo ago
yeah true that's how the components work... what are you trying to do... if it's custom CSS then it will be no problem targeting the grid
slamx_
slamx_β€’2mo ago
I've aligned the child elements, for example a toggle between a select will always have to much white space on the bottom
Tally
Tallyβ€’2mo ago
this wouldn't be a problem using css selectors for that specific grid with your class
slamx_
slamx_β€’2mo ago
I made a solution with sub selector for the grid element πŸ™‚
Tally
Tallyβ€’2mo ago
aaah nice!!