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#

Set backdrop={false} to drop the dimming backdrop. The modal opens non-modally, so the rest of the page stays interactive — close it with the button or Esc (clicking outside does nothing).

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
backdropbooleantrueShow a dimming, click-to-close backdrop. false opens the modal non-modally (no dim, page stays interactive; close via button/Esc)
backgroundBackgroundColor-Modal-box background
roundedRadiusValue | boolean-Modal-box rounding (true → theme rounded-box)
widthSizeValue-Modal-box width — Tailwind step or unitful value ("560px", "50%")
heightSizeValue-Modal-box height — same value format as width
paddingSpacing-Modal-box padding
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)