PU-Modal Component
A flexible modal dialog component with transition effects and slot-based content
Usage
Basic Usage
Method/State | Type | Description |
---|---|---|
show() | function | Opens the modal |
hide() | function | Closes the modal |
isVisible | boolean (ref) | Reactive visibility state |
Slot | Description | Default Content |
---|---|---|
header | Modal header section | Default Title text |
content | Main modal content | Default content text |
footer | Modal footer section | Close button |
- Base styling with Tailwind:
.modal-overlay { @apply fixed inset-0 flex items-center justify-center bg-white/75 z-50; } .modal-container { @apply bg-white rounded-xl p-6 shadow-lg max-w-md border-2 border-primary-light-500; }
- Transition effects:
.fade-modal-enter-active, .fade-modal-leave-active { @apply transition-opacity duration-300; } .fade-modal-enter-from, .fade-modal-leave-to { @apply opacity-0; }
- Click outside to close (backdrop click)
- Default close button in footer
- Escape key support (if implemented)
- Smooth fade transitions
useModal()
composable for state management