Command Palette

Search for a command to run...

Dialog

A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.

Usage

import { Dialog } from "@smartacteam/ambient-web/dialog";
<Dialog.Root>
  <Dialog.Trigger>Open</Dialog.Trigger>
  <Dialog.Content>
    <Dialog.Header>
      <Dialog.Title>Are you absolutely sure?</Dialog.Title>
      <Dialog.Description>
        This action cannot be undone. This will permanently delete your account
        and remove your data from our servers.
      </Dialog.Description>
    </Dialog.Header>
    <Dialog.Body>{/* Fields, lists, anything between */}</Dialog.Body>
    <Dialog.Footer>
      <Dialog.Close render={<Button>Cancel</Button>} />
      <Button variant="primary">Delete account</Button>
    </Dialog.Footer>
  </Dialog.Content>
</Dialog.Root>

Dialog.Content pads its parts with one 24px inset and stacks them 16px apart, so Dialog.Body adds no padding of its own. The close button sits in Dialog.Header's title row, centered on the title's first line; a dialog with no header pins it to the corner. showCloseButton={false} leaves it out.