If you’re using the Reindeer theme (default), then it’s only possible to do multiline buttons using the NativeButton component. Regular Button component theme does not scale vertically, hence only one line is supported.
The Runo theme supports multiple line buttons also with the regular Button component.
In either case, you need a custom theme and a custom stylename for the button (e.g. Button.addStyleName(“multiline”)) and then override a couple of properties with CSS:
Yes, I tried your solution (white-space: pre), it works. Thanks much. 1 more comment - if using white-space: normal, it will make the button caption - “Submit Request” break in two lines which is not expected sometimes. So, “white-space:pre” at this point is better solution.
I have a VerticalLayout. On this VerticalLayout I put multiline BORDERLESS buttons with styling
.v-button-multiline .v-button-caption {
white-space: normal;
}
final Button button = new Button("buttonTitle");
button.addStyleName(ValoTheme.BUTTON_BORDERLESS);
button.addStyleName("multiline");
verticalLayout.addComponent(button);
but the problem is that the first button “overgrow” second button. Do you have any idea what am I doing wrong? Is there any other way in Vaadin7, Valo there to make multiline BORDERLESS button?
PS: I can do it with NativeButton, but I want to have BORDERLESS button what is NativeButton not.
PS: on the attached picture, there should be two buttons 1. “National Geographic nenan nenne n” and 2. “World Book Kids”.