Modal 02
A destructive confirmation dialog that spells out the consequences and asks the name to be typed before deleting.
Requirements
HTML, CSS, JavaScript
Dependencies
None
Usage
Copy index.html, styles.css and script.js into your project.
Typography: Inter, with a system sans-serif fallback.
About Modal 02
Modal 02 is a modal component in the Modal Components collection, available in HTML + CSS + JavaScript and React + TypeScript + Tailwind CSS. Last updated September 16, 2026.
- modal
- destructive
What the code includes
HTML + CSS + JavaScript
3 files: index.html, styles.css, script.js
- Behavior is handled in script.js.
- ARIA in the markup: role alertdialog; aria-modal, aria-labelledby, aria-describedby, aria-disabled.
- HTML elements used: section, ul, button, input, label, svg.
- Keyboard keys handled: Escape, Tab.
- Includes a prefers-reduced-motion rule for its animation.
React + TypeScript + Tailwind CSS
3 files: Modal02.jsx, Modal02.types.ts, Modal02.tailwind.css
- Configurable through 9 props: open, resourceName, confirmPhrase, consequences, resourceKind, busy, onDelete, onClose, className.
- Uses React hooks: useEffect, useId, useRef, useState.
- ARIA in the markup: role alertdialog; aria-modal, aria-labelledby, aria-describedby, aria-disabled.
- HTML elements used: ul, button, input, label, svg.
- Keyboard keys handled: Escape, Tab.
- Includes a prefers-reduced-motion rule for its animation.
- Responsive Tailwind breakpoints used: sm.