Components
Zoom Dialog
A dialog that grows out of the button that opened it.
<ZoomDialog trigger="Order details" title="Order #2041">
<OrderSummary />
</ZoomDialog>Installation
npx shadcn@latest add https://ui.zjkm.tech/r/zoom-dialog.jsonimport { ZoomDialog } from "@/components/zoom-dialog"Using JavaScript? Set tsx: false in components.json and the CLI converts it.
New to shadcn? Run npx shadcn@latest init first. The CLI needs components.json and the @/ import alias.
Usage
A button that opens a dialog which grows out of the button itself, so it's clear where it came from. It's a native modal <dialog>: focus moves in and stays there, Escape closes it, and the page behind can't be reached.
import { ZoomDialog } from "@/components/zoom-dialog";
export function OrderRow({ order }: { order: Order }) {
return (
<ZoomDialog trigger="Details" title={`Order #${order.id}`}>
<OrderSummary order={order} />
</ZoomDialog>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
trigger | ReactNode | The opening button's label. | |
title | string | The heading and accessible name. | |
children | ReactNode | The content. | |
className | string | Classes for the opening button. |
With reduced motion, the dialog appears without growing.