Dialog Frame
The shared dialog shell: Radix dialog with focus trap, Escape and backdrop dismiss, eyebrow, title and description, a scrolling body and a pinned footer.
npx shadcn@latest add https://ui.develop-better-solutions.com/r/dialog-frame.jsonDependencies:
@radix-ui/react-dialoglucide-reactUsage
dialog-frame-example.tsx
"use client";
import { useState } from "react";
import { DialogFrame } from "@dbs/ui";
export default function DialogFrameExample() {
const [open, setOpen] = useState(false);
return (
<>
<button type="button" onClick={() => setOpen(true)} className="h-11 rounded-full bg-ink px-6 text-sm font-medium text-canvas">Open dialog</button>
<DialogFrame
open={open}
onOpenChange={setOpen}
eyebrow="Shared shell"
title="Dialog frame"
description="Focus trap, Escape and backdrop dismiss, a scrolling body and a pinned footer."
footer={<button type="button" onClick={() => setOpen(false)} className="h-11 rounded-full bg-ink px-6 text-sm font-medium text-canvas">Done</button>}
>
<p className="text-sm text-ink-muted">Put any content here. The other modals in this group are built on this frame.</p>
</DialogFrame>
</>
);
}