James Shopland

Dialog

Buttons 5

About

Here is Dialog component

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Dialog to your project and fits it to your theme.

Code

How Dialog is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { Button } from "@/components/ui/button-1"
import {
  DialogContent,
  DialogDescription,
  DialogFooter,
  DialogHeader,
  DialogOverlay,
  DialogTitle,
  DialogTrigger,
} from "@/components/ui/dialog-2"

export default function AlertDialogDemo() {
  return (
    <DialogTrigger>
      <Button variant="outline">Delete...</Button>
      <DialogOverlay isDismissable={false}>
        <DialogContent role="alertdialog" className="sm:max-w-[425px]">
          {({ close }) => (
            <>
              <DialogHeader>
                <DialogTitle>Delete file</DialogTitle>
              </DialogHeader>
              <DialogDescription>
                This will permanently delete the selected file. Continue?
              </DialogDescription>
              <DialogFooter>
                <Button onPress={close}>Cancel</Button>
                <Button variant="destructive" onPress={close}>
                  Delete
                </Button>
              </DialogFooter>
            </>
          )}
        </DialogContent>
      </DialogOverlay>
    </DialogTrigger>
  )
}

Dependencies

More by James Shopland

View all
  • Tag Group [react-aria-components]

    Tag Group [react-aria-components]

    96
  • Date Range Picker [react-aria-components]

    Date Range Picker [react-aria-components]

    88
  • Grid List [react-aria-components]

    Grid List [react-aria-components]

    73
  • Switch [react-aria-components]

    Switch [react-aria-components]

    70
  • Select [react-aria-components]

    Select [react-aria-components]

    47
  • Range Calendar [react-aria-components]

    Range Calendar [react-aria-components]

    39
  • Menu

    Menu

    36
  • Popover

    Popover

    35

More in Buttons

View all
  • Texture Button

    Texture Button

    102
  • Button

    Button

    10
  • Button

    Button

    4
  • Native Button

    Native Button

    12
  • Button Group

    Button Group

    38
  • Button

    Button

    76
  • HeroUI Button Group

    HeroUI Button Group

    11
  • Split Button

    Split Button

    36