ui/dialog.tsx

Snouzy/workout-cool · src/components/ui/dialog.tsx · typescript · MIT
ui

A reusable modal dialog component with overlay, header, footer, and close functionality.

// Source: https://github.com/Snouzy/workout-cool | License: MIT | Copyright 2023 Mathias Bradiceanu
// Provided via justclaw.it.com; keep this notice with the code.
"use client";

import * as React from "react";
import { X } from "lucide-react";
import * as DialogPrimitive from "@radix-ui/react-dialog";

import { cn } from "@/shared/lib/utils";

const Dialog = DialogPrimitive.Root;

const DialogTrigger = DialogPrimitive.Trigger;

const DialogPortal = DialogPrimitive.Portal;

const DialogClose = DialogPrimitive.Close;

const DialogOverlay = React.forwardRef<
  React.ElementRef<typeof DialogPrimitive.Overlay>,
  React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
>(({ className, ...props }, ref) => (
  <DialogPrimitive.Overlay
    className={cn(
      "fixed inset-0 z-50 bg-black

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key