Skip to content
HomeCobalt

Dialog

A window over the page for one short task, such as a form.

Examples

An invite form that checks the address, sends, then confirms.
Failed saveA failed submit keeps the dialog open and shows the error.

Credit funds

Usage

Use it when

  • You have one task to finish before the page is useful again: invite someone, rename a list, pick a date range.
  • The task has a submit that can take time, and the result must land on the same form.

Use something else when

  • The task only asks yes or no before something is removed. Use AlertDialog instead.
  • The task is a list, a set of filters or an editor that scrolls. Use Sheet instead.
  • The task is one field or one setting beside its trigger, with no need to block the page. Use Popover instead.
  • The content is only the name of a control. Use Tooltip instead.
  • The task is finding a record or a command by typing. Use CommandPalette instead.

Rules

General

Content

Avoid

Limits

Install

npx shadcn@latest add https://kaanarici.com/r/cobalt/dialog.json
import { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogBody, DialogFooter, DialogError, DialogClose } from "@/components/cobalt/ui/dialog"