# Modal
A dialog overlay component for displaying focused content that requires user attention or interaction. Supports a title, description, action buttons, and optional form wrapping. Controlled via an imperative ref with `open()` and `close()` methods.
```tsx demo
import { Button } from "@tenstorrent/vesper/button";
import { Modal, useModal } from "@tenstorrent/vesper/modal";
export default function ModalDemo() {
const modal = useModal();
return (
<>
Additional content can be placed here.
>
);
}
```
## Options
| Prop | Type | Description | Default |
| --------------------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `title` | `string` | The title text displayed in the modal header. Used for `aria-labelledby`. **Required.** | — |
| `description` | `string` | A description displayed below the title. Used for `aria-describedby`. **Required.** | — |
| `width` | `number \| string` | The width of the modal container. A number is interpreted as pixels. | `452` |
| `maxHeight` | `number \| string` | The maximum height of the modal container. A number is interpreted as pixels. | `640` |
| `buttons` | `ButtonProps[]` | An optional array of button props for action buttons. The last button defaults to `"primary"` variant; others default to `"tertiary"`. | — |
| `buttonsAlignment` | `"start" \| "end" \| "fill" \| "between"` | Controls the horizontal alignment of the action buttons. | `"end"` |
| `ref` | `Ref` | A ref exposing imperative `open()` and `close()` methods. | — |
| `closeOnClickOutside` | `boolean` | When `true`, clicking the backdrop closes the modal. | `false` |
| `form` | `FormProps` | When provided, wraps the modal content in a `