--- title: Modal desc: Modal is used to show a dialog or a box when you click a button. source: https://raw.githubusercontent.com/saadeghi/daisyui/refs/heads/master/packages/daisyui/src/components/modal.css layout: components classnames: component: - class: modal desc: Modal part: - class: modal-box desc: The content part - class: modal-action desc: Actions part (buttons, etc.) - class: modal-backdrop desc: Label that covers the page when modal is open so we can close the modal by clicking outside - class: modal-toggle desc: Hidden checkbox that controls the state of modal modifier: - class: modal-open desc: Keeps the modal open (you can add this class using JS) placement: - class: modal-top desc: Moves the modal to top - class: modal-middle desc: Moves the modal to middle default: true - class: modal-bottom desc: Moves the modal to bottom - class: modal-start desc: Moves the modal to start horizontally - class: modal-end desc: Moves the modal to end horizontally # browserSupport: chrome: 37 firefox: 98 safari: 15.4 iossafari: 15.4 --- ## There are 3 methods to use modals 1. [Using HTML `` element](#method-1-html-dialog-element) It needs JS to open but it has better accessibility and we can close it using `Esc` key 2. [Using checkbox](#method-2-checkbox) A hidden `` to control the state of modal and `