Looking for a way to make a button with flexible width while allowing text to wrap to 2 lines for minimum button size? Check out the examples below:
To keep the button width small, even short words should wrap to 2 lines:
My
Button
If there's a long description, it should still wrap to the smallest resulting width:
My button with
very long text
A long word like 'Abcdefghijklmnopqrstuvwxyz' should remain on one line, making the button larger:
Abcdefghijklmnopqrstuvwxyz
Struggling to find a way to allow wrapping without setting a fixed width? Consider exploring CSS solutions before resorting to JavaScript-based parsing and adding <br>
elements.