Modal
A modal is an overlay element which blocks interaction with elements outside it.
Installation
Install via VScode or copy and paste the code below into a new file, preferably in a folder at components/base.
BaseLayer
Examples
Default
bl-modal
import { Button } from "@/components/base/button";
import { Modal, ModalContent, ModalTrigger } from "@/components/base/modal";
import { AlertTriangle } from "lucide-react";
import { Heading } from "react-aria-components";
export const ModalExample = () => {
return (
<ModalTrigger>
<Button className="bg-critical hover:bg-critical/70">
Delete Project
</Button>
<Modal>
<ModalContent>
{({ close }) => (
<>
<AlertTriangle className="h-8 w-8 text-critical" />
<Heading className="text-lg font-bold">Warning</Heading>
<p className="text-sm text-fg-3">
Your data will be permenantly deleted, proceed?
</p>
<div className="flex justify-center gap-4">
<Button state="outline" intent="secondary" onPress={close}>
Cancel
</Button>
<Button
className="bg-critical hover:bg-critical/70"
onPress={close}
>
Delete
</Button>
</div>
</>
)}
</ModalContent>
</Modal>
</ModalTrigger>
);
};