Skip to content

Optionally remove margins around Dialog #5765

Open
@rolfsmeds

Description

@rolfsmeds

Describe your motivation

There are at least two common UI patterns that call for a dialog (or similar overlay) that sits flush with the edges of the browser viewport:

  • Full-screen modals on mobile (these are different from "views" in that they don't require navigating away from the current view, and they typically obscure the app's navigation controls). Full-screen modals are often used on mobiles to maximize utilization of the small viewport.

  • Side panel overlays (modal or not) on bigger viewports, e.g.:
    image

The Dialog component currently doesn't make it easy to achieve due to the --lumo-space-m margin that always surrounds them:
image
image

Describe the solution you'd like

In addition to a positioning API as proposed in #1060 and vaadin/flow-components#1173, it would be nice to also have a way to disable the margin.

This could be either through a margin API e.g. setMargin(boolean) / no-margin, or a theme variant.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions