DDBS UI
primitive

Modal

A branded, accessible dialog built on Radix, with a labelled title and a dismissable overlay.

npx shadcn@latest add https://ui.develop-better-solutions.com/r/modal.json
Dependencies:@radix-ui/react-dialoglucide-react
Uses:badge
Fullscreen

Usage

modal-example.tsx
"use client";

import { Button, Modal } from "@dbs/ui";
import { useState } from "react";

export default function ModalExample() {
  const [open, setOpen] = useState(false);

  return (
    <>
      <Button variant="indigo" onClick={() => setOpen(true)}>
        Open modal
      </Button>
      <Modal
        open={open}
        onOpenChange={setOpen}
        badge="Get started"
        title="Start a project"
        description="Tell us the job to be done and we will come back with a plan and a timeline."
      >
        <div className="flex gap-3">
          <Button variant="accent" onClick={() => setOpen(false)}>
            Send brief
          </Button>
          <Button variant="ghost" onClick={() => setOpen(false)}>
            Cancel
          </Button>
        </div>
      </Modal>
    </>
  );
}