Use CSS Grid to stack items, and visibility: hidden to hide/show spinner.
This approach allows the largest item to size the button, and keeps the button text accessible
Help me, you're my only hope
I have a button that should display a loading spinner, usually with a different width than the content.
but how do I prevent the button from resizing when it does?
- I do not want to set fixed pixel width on all buttons
- I need a tailwind or react solution