--- title: Custom overlay examples description: Build result-producing modals, sheets, and drawers with UI components. order: 30 toc: - id: typed-modal title: Typed modal - id: sheet title: Sheet - id: drawer title: Drawer --- ## Typed modal {#typed-modal} The render callback receives `close` and `dismiss`. `close` returns an application result while `dismiss` follows the cancellation path. ```tsx import { openModal } from "@workspace/overlays/modal" import { Button } from "@workspace/ui/components/button" function PlanButton() { async function choosePlan() { const plan = await openModal<"free" | "pro">({ title: "Choose a plan", description: "You can change this later.", content: ({ close, dismiss }) => (