Oddmash UI
すべてのコンポーネント

Dialog

編集や確認のためにモーダルを開きます。

使い方

現在の画面が文脈となる操作に使い、閉じる手段を用意します。

アクセシビリティ

DialogTitle と DialogDescription を付けます。Escape で閉じるとフォーカスが戻ります。

プロパティ型既定値
open / defaultOpenbooleanfalse
onOpenChange(open: boolean) => voidNone
theme (DialogContent)light | darkinherited
container (DialogContent)HTMLElementdocument.body
<Dialog>
  <DialogTrigger asChild><Button>Edit project</Button></DialogTrigger>
  <DialogContent>
    <DialogTitle>Project settings</DialogTitle>
    <DialogDescription>Give your project a name.</DialogDescription>
    <label htmlFor="name">Name</label>
    <Input id="name" defaultValue="Interaction Inspector" />
    <DialogClose asChild><Button>Done</Button></DialogClose>
  </DialogContent>
</Dialog>

インタラクティブなドキュメント