Skip to content

Component gallery

  1. Primitives
  2. Dialogs

Primitives

  • Buttons30
  • Badges21
  • Keys4
  • Status8
  • Avatars8
  • Alerts4
  • Cards10
  • Dropdowns4
  • Corner windows3
  • Dialogs7
  • Windows4
  • Taskbar1
  • Launcher1
  • Desk icons1
  • Progress8
  • Scroll cues2

Forms

  • Toggles5
  • Selects3
  • Inputs8
  • Textareas7
  • Segmented controls4
  • Attachments18

Content

  • Quotes5
  • Stats5
  • Heatmap3
  • Icon lists2
  • Masonry2
  • Accordion2
  • Code8
  • Contact methods7

Chat

  • Messages22
  • Posts29

Showcase

  • Media cards4
  • Logos1
  • 88x31s15
  • Carousel3
  • Blueprint frames2
  • Card grids3

Media

  • Figures4
  • Audio player4
  • Media player3
  • Radio5
  • Shorts2

Toys

  • Terminal4
  • Destructor1
  • Status board7

Sections

  • Section3
  • Side hero2
  • Navbar5
  • Footer1
  • Sidebar2

Display

ThemeT
Mode
Mode
M
Style
Style
Y
Spacing
Spacing
Radius
Radius
Font size
Font size
Compare
Compare
Effects
S

ShortcutsAlt+Shift+key

Components

Primitives

  • Buttons30
  • Badges21
  • Keys4
  • Status8
  • Avatars8
  • Alerts4
  • Cards10
  • Dropdowns4
  • Corner windows3
  • Dialogs7
  • Windows4
  • Taskbar1
  • Launcher1
  • Desk icons1
  • Progress8
  • Scroll cues2

Forms

  • Toggles5
  • Selects3
  • Inputs8
  • Textareas7
  • Segmented controls4
  • Attachments18

Content

  • Quotes5
  • Stats5
  • Heatmap3
  • Icon lists2
  • Masonry2
  • Accordion2
  • Code8
  • Contact methods7

Chat

  • Messages22
  • Posts29

Showcase

  • Media cards4
  • Logos1
  • 88x31s15
  • Carousel3
  • Blueprint frames2
  • Card grids3

Media

  • Figures4
  • Audio player4
  • Media player3
  • Radio5
  • Shorts2

Toys

  • Terminal4
  • Destructor1
  • Status board7

Sections

  • Section3
  • Side hero2
  • Navbar5
  • Footer1
  • Sidebar2

Primitives · 10 of 16

Dialogs

Inline here so they can be seen; a modal centred over the page on wide screens and a bottom sheet on narrow ones. Open buttons show the real modal.

packages/ui/src/astro/ui/dialog.astro7 stories

Preview settings
Width
Preview width
Stage
Stage
confirm
Props of confirm
<Dialog id="story-dialog-confirm" title="Remove Earth?" size="sm" inline>
    <p>This also removes its 2 moons. You can't undo this.</p>
    <Button slot="footer" variant="outline" tone="neutral" commandfor="story-dialog-confirm" command="close">Cancel</Button>
    <Button slot="footer" tone="destructive" commandfor="story-dialog-confirm" command="close">
        <Icon name="lucide:trash-2" />
        Remove
    </Button>
</Dialog>
Open dialog/confirm on its own

Remove Earth?

This also removes its 2 moons. You can't undo this.

form
Props of form
<Dialog id="story-dialog-form" title="Add a body" form inline>
    <Input label="Name" name="name" autofocus={false} placeholder="Name" />
    <Select label="Kind" name="kind" options={[{ value: "planet", label: "Planet" }, { value: "moon", label: "Moon" }, { value: "asteroid", label: "Asteroid" }]} />
    <Input label="Mass in kilograms" name="mass" type="number" placeholder="Mass (kg)" />
    <Button slot="footer" variant="outline" tone="neutral" commandfor="story-dialog-form" command="close">Cancel</Button>
    <Button slot="footer" type="submit">Add</Button>
</Dialog>
Open dialog/form on its own

Add a body

long
Props of long
<Dialog id="story-dialog-long" scrollable title="A title that is long enough that it has to wrap onto a second line in the header" inline>
    <p>Paragraphs stack with a gap between them. When the content is taller than th…
    <Button slot="footer" commandfor="story-dialog-long" command="close">Done</Button>
</Dialog>
Open dialog/long on its own

A title that is long enough that it has to wrap onto a second line in the header

Paragraphs stack with a gap between them. When the content is taller than the dialog's maximum height, the body scrolls and the header and footer stay put.

Paragraphs stack with a gap between them. When the content is taller than the dialog's maximum height, the body scrolls and the header and footer stay put.

Paragraphs stack with a gap between them. When the content is taller than the dialog's maximum height, the body scrolls and the header and footer stay put.

Paragraphs stack with a gap between them. When the content is taller than the dialog's maximum height, the body scrolls and the header and footer stay put.

Paragraphs stack with a gap between them. When the content is taller than the dialog's maximum height, the body scrolls and the header and footer stay put.

Paragraphs stack with a gap between them. When the content is taller than the dialog's maximum height, the body scrolls and the header and footer stay put.

no-close
Props of no-close
<Dialog id="story-dialog-no-close" title="Saved" size="sm" closeButton={false} inline>
    <p>Your changes are saved.</p>
    <Button slot="footer" commandfor="story-dialog-no-close" command="close">OK</Button>
</Dialog>
Open dialog/no-close on its own

Saved

Your changes are saved.

modal
Props of modal
<Dialog id="story-dialog-modal" title="Remove Earth?" size="sm" trigger="Open confirm (sm)">
    <p>This also removes its 2 moons. You can't undo this.</p>
    <Button slot="footer" variant="outline" tone="neutral" commandfor="story-dialog-modal" command="close">Cancel</Button>
    <Button slot="footer" tone="destructive" commandfor="story-dialog-modal" command="close">
        <Icon name="lucide:trash-2" />
        Remove
    </Button>
</Dialog>
Open dialog/modal on its own

Remove Earth?

This also removes its 2 moons. You can't undo this.

form-modal
Props of form-modal
<Dialog id="story-dialog-form-modal" title="Add a body" form inline={false} trigger="Open form (md)">
    <Input label="Name" name="name" autofocus placeholder="Name" />
    <Select label="Kind" name="kind" options={[{ value: "planet", label: "Planet" }, { value: "moon", label: "Moon" }, { value: "asteroid", label: "Asteroid" }]} />
    <Input label="Mass in kilograms" name="mass" type="number" placeholder="Mass (kg)" />
    <Button slot="footer" variant="outline" tone="neutral" commandfor="story-dialog-form-modal" command="close">Cancel</Button>
    <Button slot="footer" type="submit">Add</Button>
</Dialog>
Open dialog/form-modal on its own

Add a body

light-dismiss
Props of light-dismiss
<Dialog id="story-dialog-light-dismiss" title="Light dismiss" size="sm" trigger="Open (click outside closes)" lightDismiss>
    <p>Click anywhere outside this dialog to close it.</p>
</Dialog>
Open dialog/light-dismiss on its own

Light dismiss

Click anywhere outside this dialog to close it.

PreviousCorner windowsNextWindows