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
seems the extraAttributes sets it per whole repeater and not per item Thanks
7 Replies
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
I want to be able to set it for each item individually
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
I’m using repeater to manage entity relationship where the entity can have multiple such items
Example and order with multiple products …
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
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.
understand, would be nice if filament could do this