# dialog.task

A focused task that blocks the page until done or dismissed: edit settings, compose

Component: [`<Dialog>`](https://www.prongs.dev/docs/components/dialog.md) · Renders: `<dialog>` · Profile: [UI](https://www.prongs.dev/docs/intents/ui.md)

## Example

```tsx
<Dialog intent="dialog.task" open={open} onClose={() => setOpen(false)} label="Title">
  …
</Dialog>
```

## Choosing between neighbours

Find the row that describes your element, and use the intent on the right.

| If it is for… | Use |
|---|---|
| A focused task that blocks the page until done or dismissed: edit settings, compose | `dialog.task` (this page) |
| Something that interrupts the page until dealt with (rather than [`layout.disclosure`](https://www.prongs.dev/docs/intents/layout/disclosure.md)) | `dialog.task` (this page) |
| A form or anything with several steps (rather than [`dialog.confirm`](https://www.prongs.dev/docs/intents/dialog/confirm.md)) | `dialog.task` (this page) |
| Editing or deciding something (rather than [`dialog.reader`](https://www.prongs.dev/docs/intents/dialog/reader.md)) | `dialog.task` (this page) |
| A task to finish before going back to the page (rather than [`dialog.drawer`](https://www.prongs.dev/docs/intents/dialog/drawer.md)) | `dialog.task` (this page) |
| A task that needs the user’s full attention (rather than [`popover.menu`](https://www.prongs.dev/docs/intents/popover/menu.md)) | `dialog.task` (this page) |

## Connections

Declared in the registry, both directions. Where an intent is used in your own code is something check and the gallery see; this site has no app code.

- Built from: [`surface.overlay`](https://www.prongs.dev/docs/intents/ui.md#surface-overlay)

## For registry authors

**Starter intents.** These are the intents `prongs add` puts in your registry, shown in this site’s theme. Yours are your own `registry.ts`: rename, restyle and add to them, and see them with `prongs add gallery`.

What this intent is built from and its entry in `components/prongs/registry.ts`. You only need this to change how it looks or to add an intent like it.

How dialog.task resolves, and its definition

Each layer adds to the one before it; a later class wins over an earlier one that sets the same thing.

- [`surface.overlay`](https://www.prongs.dev/docs/intents/ui.md#surface-overlay) — Floats over a dimmed page and starts its own stack of surfaces

  ```
  surface-overlay m-auto rounded-lg border border-surface-border
  shadow-xl backdrop:bg-black/50
  ```

- `dialog.task` (this page) — A focused task that blocks the page until done or dismissed: edit settings, compose

  ```
  w-[min(32rem,calc(100%-2rem))] p-6
  ```

Final classes

```
surface-overlay m-auto rounded-lg border border-surface-border
shadow-xl backdrop:bg-black/50 w-[min(32rem,calc(100%-2rem))]
p-6
```

Definition

```ts
'dialog.task': {
  kind: 'semantic',
  description: 'A focused task that blocks the page until done or dismissed: edit settings, compose',
  refs: ['surface.overlay'],
  binding: { classes: 'w-[min(32rem,calc(100%-2rem))] p-6' },
},
```
