Dialog

A modal that grows out of its button, traps focus and gives it back.

Features

  • Grows out of its button on the morph spring, over a soft backdrop.

Use it for

  • Confirmations.

Installation

  1. Get runets.
    git clone https://github.com/ziyam-khan/runets
  2. Copy these files into your project, keeping their folders.
  3. Install what they use.
    pnpm add react @base-ui/react motion lucide-react
  4. Load the styles once. Bring your own base tokens, or use runets’ default theme.
    import 'runets/styles/theme.css'
    import 'runets/styles/kit.css'

Usage

import { Dialog } from 'runets'

<Dialog trigger="Delete branch" title="Delete this branch?" description="…" confirm="Delete" onConfirm={remove} />

API

PropTypeWhat it does
titlestringHeading.
descriptionstringBody.
confirmstringConfirm label.
onConfirm() => voidCalled on confirm.

Accessibility

Source

The code is in src/kit/overlays.tsx in runets, MIT licensed.