Modal 04
A command palette dialog with search, grouped commands, shortcuts and full keyboard navigation.
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 04
Modal 04 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
- command palette
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: roles dialog, combobox, listbox; aria-live, aria-modal, aria-labelledby, aria-expanded, aria-controls, aria-autocomplete and 1 more.
- HTML elements used: section, aside, button, input, svg.
- Keyboard keys handled: Escape, Enter, ArrowUp, ArrowDown, Home, End, Tab.
- Includes a prefers-reduced-motion rule for its animation.
React + TypeScript + Tailwind CSS
3 files: Modal04.jsx, Modal04.types.ts, Modal04.tailwind.css
- Configurable through 6 props: open, commands, placeholder, onRun, onClose, className.
- Uses React hooks: useEffect, useId, useRef, useState.
- ARIA in the markup: roles dialog, combobox, listbox, group, option; aria-modal, aria-labelledby, aria-expanded, aria-controls, aria-autocomplete, aria-activedescendant and 3 more.
- HTML elements used: aside, button, input, svg.
- Keyboard keys handled: Escape, Enter, ArrowUp, ArrowDown, Home, End, Tab.
- Includes a prefers-reduced-motion rule for its animation.
- Responsive Tailwind breakpoints used: sm.