Skip to main content

Dialog

A controlled dialog component.

Usage

import { Dialog, Button } from "@fedibtc/ui"
import { useState } from "react"

function MyFunction() {
const [open, setOpen] = useState(false)

return (
<div>
<Button onClick={() => setOpen(true)}>Open Dialog</Button>

<Dialog
title="I am a Dialog"
description="This is my description"
open={open}
onOpenChange={setOpen}
>
<p>Here is my content</p>
</Dialog>
</div>
)
}

Props

NameTypeDescription
openbooleanWhether the dialog is open or not.
onOpenChange(open: boolean) => voidA callback fired when the dialog is requested to be closed.
childrenReact.ReactNodeThe content of the dialog.
titleReact.ReactNodeThe title of the dialog.
descriptionReact.ReactNodeThe description of the dialog.
size"sm" | "md" | "lg"The size of the dialog. Must be one of "sm", "md", or "lg".
disableClosebooleanWhether the close button should be disabled (hidden) or not.