F
Filament6mo ago
Milorn

Center toggle component

Inside my form i have a Toggle next to a TextInput both with hidden labels like in the image
No description
6 Replies
Milorn
Milorn6mo ago
The toggles seem a bit off and not vertically centered with the TextInput, how can i center them as well, i tried adding tailwind classes through extraAttributes but that didn't work
Milorn
Milorn6mo ago
No description
Np
Np6mo ago
Check the toggle component attributes in component of vendor files @Milorn . May be you will get answer there
Milorn
Milorn6mo ago
@Np it's basically the problem of the container inside the repeater, and from what i've read i can't have access to that container from inside the repeater item (the toggle) so i extended the repeater and i overrid a function to add extra attributes flex justify-center items-center to the container
Milorn
Milorn6mo ago
No description
awcodes
awcodes6mo ago
Just do extraInputAttributes on the toggle and use ‘style’ instead of class to add the needed margin top. Could use TW classes to be you’d need to use a custom theme if you don’t have one. Toggles are never going to match up to true center which is why it’s generally recommended to use them on their own row and not inline (without a label)