Content
- Title says what you're doing: "Add a network", "Edit Saltmarsh Partners".
A centered dialog for creating or editing a small record. For "are you sure?", use ConfirmDialog.
import { … } from "@brdgapp/ui/components/dialog"Dialog is a centered window for creating or editing a small record — adding a network, editing a contact — without leaving the page. It has a title, a short form and a footer with the actions. It is not for "are you sure?" questions: that's ConfirmDialog.
Add a network
A community or fund you belong to.
Network name
Drawn in place and smaller. The real dialog opens over the page.
Backdrop. Dims and blurs the page.
Panel. Up to 512px wide, raised surface, 16px corners, the dialog shadow. Scrolls inside if the form is tall.
Header. Title (16px Bold), an optional line under it, and a Close button.
Body. The form.
Footer. A destructive action alone on the left; Cancel and the primary action on the right.
Leave the name empty and move on to see the error; Save runs a pretend request.
| State | What happens |
|---|---|
| Open | Focus moves into the dialog and stays there. |
| Busy | Saving: Close, Esc and the backdrop do nothing until it finishes. |
| Closed | Focus returns to what opened it. |
busy.Do
Keep it to a few fields.Don't
Put a whole settings page in a dialog.Do
One primary button, named for the action (Save, Add).Don't
Two filled buttons in the footer.aria-describedby.| Keys | Action |
|---|---|
| Tab | Moves through the form and stays inside the dialog. |
| Esc | Closes it (unless busy). |
Dialog
The dialog, built on Base UI Dialog.
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | — | Whether it shows. |
onClose | () => void | — | Called on Close, Esc or the backdrop (not while busy). |
title | string | — | What it does. |
description | ReactNode | — | One line under the title. |
children | ReactNode | — | The form. |
footer | ReactNode | — | The buttons, right-aligned: Cancel, then the primary action. A destructive action goes first with className="mr-auto", which puts it alone on the left. |
busy | boolean | false | Can't be dismissed. |
What it's built from and where it's used, read from the code. When you change it, check these too.
Where the code still differs from the system. Follow the system, not the gap.
network-entry-modal.tsx (shape, footer, busy lock).