Dialog

A window overlaid on either the primary window or another dialog window.

Installation

npx lovdacn@latest add dialog

(You can also use the shortened lvcn alias, e.g., npx lvcn@latest add dialog)

This copies the component source into your project (typically components/ui/dialog.tsx) and installs any required dependencies.

Registry dependencies: utils, button, text, icon

Usage

import {
  Dialog,
  DialogContent,
  DialogDescription,
  DialogHeader,
  DialogTitle,
  DialogTrigger,
} from "@/components/ui/dialog"
import { Button } from "@/components/ui/button"
import { Text } from "@/components/ui/text"

export function Example() {
  return (
    <Dialog>
      <DialogTrigger asChild>
        <Button>
          <Text>Open</Text>
        </Button>
      </DialogTrigger>
      <DialogContent>
        <DialogHeader>
          <DialogTitle>
            <Text>Dialog title</Text>
          </DialogTitle>
          <DialogDescription>
            <Text>Dialog description</Text>
          </DialogDescription>
        </DialogHeader>
      </DialogContent>
    </Dialog>
  )
}

Styles

lvcn components are available across all style packs:

StyleNotes
defaultClassic rounded system
new-yorkCompact, refined
novaSharp corners (default in many setups)
luma / lyra / maia / miraRadius & font variants
rhea / sera / vegaPill, zero-radius, balanced

Style is set at project init via lvcn.json (style + styleEngine).

Platform

These components target Expo / React Native with NativeWind or Uniwind. They use Platform.select where web and native need different behavior.