# UI (/docs/products/dash-dots/reference/dash-api/ui)

## `dash.ui.alert`

```ts
dash.ui.alert(options: AlertOptions, callOptions?: CallOptions): DashRequest<AlertResult>
```

Shows the phone's own alert. Resolves with the action the person chose.

Types: [`AlertOptions`](/docs/products/dash-dots/reference/dash-api/ui#alertoptions), [`AlertResult`](/docs/products/dash-dots/reference/dash-api/ui#alertresult)

## `dash.ui.pickDate`

```ts
dash.ui.pickDate(options?: PickDateOptions, callOptions?: CallOptions): DashRequest<string>
```

Opens the phone's own calendar. Resolves with the chosen date, such as "2026-10-24", or rejects with `cancelled` if the person closes it.

Types: [`PickDateOptions`](/docs/products/dash-dots/reference/dash-api/ui#pickdateoptions)

## `dash.ui.pickTime`

```ts
dash.ui.pickTime(options?: PickTimeOptions, callOptions?: CallOptions): DashRequest<string>
```

Opens the phone's own clock. Resolves with the chosen time in 24 hours, such as "19:30", or rejects with `cancelled` if the person closes it.

Types: [`PickTimeOptions`](/docs/products/dash-dots/reference/dash-api/ui#picktimeoptions)

## Types

### `AlertAction`

| Field             | Type                                     | What it is                                                                                                                                                                                                            |
| ----------------- | ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`              | `string`                                 | What the alert resolves with, as `action`, when the person chooses this action.                                                                                                                                       |
| `label`           | `string`                                 |                                                                                                                                                                                                                       |
| `role` (optional) | `'default' \| 'cancel' \| 'destructive'` | `cancel` closes the alert, and on Android, Back or a tap outside the alert chooses it too. Without a `cancel` action, the alert stays until the person picks one. `destructive` marks something that can't be undone. |

### `AlertOptions`

| Field                | Type                                                                          | What it is                                                              |
| -------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `title`              | `string`                                                                      |                                                                         |
| `message` (optional) | `string`                                                                      | Dash ends it with a line naming the dot, such as "From Plasas Kitchen". |
| `actions` (optional) | [`AlertAction[]`](/docs/products/dash-dots/reference/dash-api/ui#alertaction) | Default: one OK button. An empty list fails with `invalid`.             |

### `AlertResult`

| Field    | Type     | What it is                               |
| -------- | -------- | ---------------------------------------- |
| `action` | `string` | The `id` of the action the person chose. |

### `PickDateOptions`

| Field              | Type     | What it is                                                   |
| ------------------ | -------- | ------------------------------------------------------------ |
| `title` (optional) | `string` |                                                              |
| `value` (optional) | `string` | The date chosen when the picker opens, such as "2026-10-24". |
| `min` (optional)   | `string` | The earliest date the person can pick, such as "2026-10-01". |
| `max` (optional)   | `string` | The latest date the person can pick, such as "2026-12-31".   |

### `PickTimeOptions`

| Field              | Type     | What it is                                                                |
| ------------------ | -------- | ------------------------------------------------------------------------- |
| `title` (optional) | `string` |                                                                           |
| `value` (optional) | `string` | A time of day in 24 hours, such as "19:30", chosen when the picker opens. |
