How can i center the content of a dialog ? #3167
Unanswered
daviddanielng
asked this question in
Q&A
Replies: 1 comment 2 replies
|
Use the dialog's window.open_dialog(cx, |dialog, _, _| {
dialog
.h(px(300.)) // give vertical centering some space to work with
.content(|content, _, _| {
content
.items_center() // horizontal (flex cross axis)
.justify_center() // vertical (flex main axis)
.child("Centered content")
})
});If you also use |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I do not want to center the contents, but the dialog. i.e the container.
rendered with
Here you will see the contents are not centered, i was able to centre it by using

use gpui_kit::component::*;, but it is a lot more work.All reactions