Center toggle component
Inside my form i have a Toggle next to a TextInput both with hidden labels like in the image
6 Replies
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
Check the toggle component attributes in component of vendor files @Milorn . May be you will get answer there
@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
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)