Skip to content

How to Vertically Center an Image in a Scrollable Dialog Window #3024

Closed Answered by falkoschindler
happybeginning1 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @happybeginning1,

Here is a possible solution with a card:

with ui.dialog(value=True):
    with ui.scroll_area().classes('w-full h-full bg-transparent'):
        with ui.card().classes('w-full my-auto').tight():
            ui.image('https://picsum.photos/seed/picsum/800/800')

and without:

with ui.dialog(value=True):
    with ui.scroll_area().classes('w-full h-full bg-transparent'):
        ui.image('https://picsum.photos/seed/picsum/800/800').classes('my-auto')

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@happybeginning1
Comment options

Answer selected by happybeginning1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants