Modal#

Modal is used to show a dialog or a box when you click a button.

Import#

TSX
import { Modal } from '@sigx/daisyui';

Basic Usage#

A basic modal with header, body, and action buttons.

TSX
Loading preview...

Close on Backdrop Click#

By default, the modal includes a backdrop. Clicking outside the modal-box closes it.

TSX
Loading preview...

Custom Width#

Pass a custom class to control the modal-box width.

TSX
Loading preview...

Position: Top#

TSX
Loading preview...

Position: Bottom#

TSX
Loading preview...

Without Backdrop#

Disable the backdrop to prevent closing by clicking outside.

TSX
Loading preview...

Props#

PropTypeDefaultDescription
modelSignal<boolean>undefinedTwo-way binding for open/close state
position'top' | 'middle' | 'bottom'undefinedVertical position of the modal
align'start' | 'end'undefinedHorizontal alignment of the modal
backdropbooleantrueWhether to show a clickable backdrop to close the modal
classstringundefinedAdditional CSS classes applied to the modal-box

Sub-components#

ComponentDescription
Modal.HeaderTitle area with an automatic close button
Modal.BodyContent area with vertical padding
Modal.ActionsAction buttons area (uses modal-action class)