Ripple Dialog

A modal that opens as a ripple from where you clicked. Native <dialog>, so focus and Escape just work.

no dependenciesMIT · free

Delete this project?

This removes the project and its 12 deployments. You can't undo this.

Installation

npx shadcn@latest add https://ombakui.com/r/ripple-dialog.json

Usage

import { RippleDialog } from "@/components/ripple-dialog";

<RippleDialog
  trigger={<button>Delete project</button>}
  title="Delete this project?"
  description="You can't undo this."
>
  <form method="dialog"><button>Cancel</button></form>
</RippleDialog>

// or controlled
<RippleDialog open={open} onOpenChange={setOpen} title="Settings">…</RippleDialog>

Props

PropTypeDefaultDescription
openboolean–Open state (controlled).
onOpenChange(open: boolean) => void–Called when the dialog wants to open or close.
triggerReactNode–Element that opens the dialog on click, e.g. a button. The ripple starts where it was clicked.
title*ReactNode–Dialog heading, also its accessible name.
descriptionReactNode–Optional line under the title.
childrenReactNode–Dialog body.
dismissiblebooleantrueClose when the backdrop is clicked.
classNamestring–