Dialog

Playground

Properties

Size
Close button

Content

Title
Description
Body
Confirm
Cancel

AlertDialog

Use AlertDialog for important decisions that need an explicit confirm or cancel action. It focuses the cancel button first and does not close with Escape.

Properties

Size

Content

Title
Description
Confirm
Cancel

SplitDialog

Content

Title
Description
Left content
Right content
Confirm
Cancel

Usage

DialogContent includes the backdrop, portal and close button. Use hasClose to show or hide the button and closeLabel to name it. Use AlertDialog for decisions that need an explicit confirm or cancel action. Use SplitDialog to divide content into two sections.

'use client';
import {
  Dialog,
  DialogTrigger,
  DialogContent,
  DialogHeader,
  DialogTitleGroup,
  DialogTitle,
  DialogDescription,
  DialogBody,
  Button,
} from '@mbsw/ui';

export default function Example() {
  return (
    <Dialog>
      <DialogTrigger asChild>
        <Button>open</Button>
      </DialogTrigger>
      <DialogContent size="sm" closeLabel={"Close dialog"}>
        <DialogHeader>
          <DialogTitleGroup>
            <DialogTitle>Title</DialogTitle>
            <DialogDescription>description</DialogDescription>
          </DialogTitleGroup>
        </DialogHeader>
        <DialogBody>contents</DialogBody>
      </DialogContent>
    </Dialog>
  );
}

The Playground Code tab includes the full example with your current settings. See Installation for the CSS imports.

Composition