Set css class per repeater item

Hello, Is it possible to set a custom css class per each repeater item using a closure ?
seems the extraAttributes sets it per whole repeater and not per item Thanks
7 Replies
biebthesecond
biebthesecond2w ago
Don't think that exists, did you want every item to have the same CSS changes? You might be able to throw in a PR then to make it yourself
jamesro
jamesroOP2w ago
I want to be able to set it for each item individually
biebthesecond
biebthesecond2w ago
Are you sure a repeater is the right option then? I feel that's kinda against the point of a repeater Because if there's gonna be a static amount of items you're better off using something like a fieldset or section maybe I don't know what the use-case is though
jamesro
jamesroOP2w ago
I’m using repeater to manage entity relationship where the entity can have multiple such items Example and order with multiple products …
biebthesecond
biebthesecond2w ago
Okay repeater is definitely the correct field to use then. Well I'm not sure if there's a solution for that. But like I said, you could try to send in a PR and they could include it in filament
awcodes
awcodes2w ago
The only way you’re going to be able to do this would be to add classes to specific input elements then target the repeater item in css with the :has() pseudo selector in a custom theme.
jamesro
jamesroOP2w ago
understand, would be nice if filament could do this

Did you find this page helpful?