Dialog

Displays content in a modal overlaid onto the primary content.
Delete your account?This action cannot be undone. This will permanently remove all data from our servers.
Properties
No properties to configure
Example
Source Code
Installation
"use client";

import React from "react";
import { Button } from "@/subframe/components/Button";
import { Dialog } from "@/subframe/components/Dialog";

function DialogExample() {
  return (
    <Dialog open={false} onOpenChange={(open: boolean) => {}}>
      <Dialog.Content>
        <div className="flex w-96 flex-col items-start gap-6 px-6 py-6">
          <div className="flex flex-col items-start gap-1">
            <span className="text-heading-3 font-heading-3 text-default-font">
              Delete your account?
            </span>
            <span className="text-body font-body text-default-font">
              This action cannot be undone. This will permanently remove all
              data from our servers.
            </span>
          </div>
          <div className="flex w-full grow shrink-0 basis-0 flex-col items-end justify-center gap-2">
            <div className="flex items-start gap-2">
              <Button
                variant="neutral-tertiary"
                icon={null}
                onClick={(event: React.MouseEvent<HTMLButtonElement>) => {}}
              >
                Cancel
              </Button>
              <Button
                variant="destructive-primary"
                icon="FeatherTrash2"
                onClick={(event: React.MouseEvent<HTMLButtonElement>) => {}}
              >
                Delete
              </Button>
            </div>
          </div>
        </div>
      </Dialog.Content>
    </Dialog>
  );
}

export default DialogExample;

Props

Dialog
Content
Prop
Type
Default
Additional info
children
React.ReactNode
open
boolean
Whether the dialog is currently opened.
onOpenChange
(open: boolean) => void
Handler called when opened or closed.

Examples

Basics

Use open and onOpenChange props to control the open state.