Modal ✨
Accessible modal dialogs with customizable styles, confirmations, and animations. Perfect for alerts, forms, and user interactions.
Quick Start
1. Import the component:
import ModalBasic from '@/components/ModalBasic';
import ModalConfirmation, { ConfirmStyle } from '@/components/ModalConfirmation';2. Basic usage:
const [modalOpen, setModalOpen] = useState(false);
<Button onClick={() => setModalOpen(true)}>
Open Modal
</Button>
<ModalBasic
modalOpen={modalOpen}
setModalOpen={setModalOpen}
title="My Modal"
>
<div className="p-5">
<p>Modal content goes here...</p>
</div>
</ModalBasic>3. Confirmation modal:
<ModalConfirmation
modalOpen={confirmOpen}
setModalOpen={setConfirmOpen}
style={ConfirmStyle.danger}
title="Delete Item?"
description="This action cannot be undone."
onConfirm={async () => {
await deleteItem();
}}
/>Basic
Basic modal
Border under title
Customer footer
Basic modal
scrollbar on modal content
white bg header
Confirmation modal
question style
Custom based on basic modal
Confirmation/Feedback
Confirmation modal
No title
ConfirmStyle.success
custom icon (warning)
custom confirm button style
Product
form
basic
subscribe to news
basic
ss