3

I am pretty new to Vaadin and wonder how to layout dialogs (com.vaadin.flow.component.dialog). As far as I see, I can simply add Components to a dialog, but how can I layout or format the components in that dialog?

I'm trying to create a simple confirmation dialog. It works, but the buttons nearly overlap each other and this way it definitely can't be delivered to any customers. So, how can I format / layout a dialog? Or, do I have to give an Id to the dialog and do all the formatting using CSS?

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
user1119859
  • 669
  • 2
  • 9
  • 20

1 Answers1

4

You do the layout of the dialog in the same manner that you would do the layout of any other component: you use the appropriate layout component, with whatever nested components and layouts give you the desired look. The styling of the dialog is done the same way as any other component.

Rob
  • 6,247
  • 2
  • 25
  • 33
  • ah, ok. I simply added Buttons directy to it, but the better approach would be to add the buttons so a horizontal- or vertical Layout and to add this to the dialog. This way I can also add a css class to it. – user1119859 Apr 01 '19 at 13:19
  • Styling is *almost* the same as any other component: Setting the width/height is wonky. See [this](https://stackoverflow.com/q/59850993/642706) and [this](https://stackoverflow.com/q/55631881/642706). – Basil Bourque Jan 23 '20 at 04:58