Modal
Interrupt for a decision or a short form that must finish before going on.
Quick usage
Import the shared component; never copy its markup into a feature. The Web TSX tab beside the live stage has a complete, working example.
import Modal from '@/shared/components/Modal';Live stage and code
The live component and its controls on the left, the code on the right; change a control and the code follows: Web TSX (the component in a working example), Tailwind and HTML (the markup it renders, with its data attributes), React Native, SwiftUI and Jetpack Compose. The header theme switch drives every stage.
Props
Read from the component's source when the docs build: names and defaults from its signature, types and descriptions from its JSDoc. A blank type means the prop has no JSDoc yet.
| Prop | Type | Default | Description |
|---|---|---|---|
children | - | - | - |
onClose | - | - | - |
title | - | - | - |
dsV1 | - | false | - |
wide | - | false | - |
maxWidth | - | - | - |
closeOnBackdrop | - | true | - |
front | - | false | - |
Source: frontend/src/shared/components/Modal/Modal.js
DOM contract
What the rendered element carries: the data attributes its styles key on, its roles and ARIA, its focus style, and whether its stylesheet draws the 44px hit boundary. Also read from the source.
| Data attributes | data-ds |
| Roles | Native element semantics only |
| ARIA | aria-label |
| Focus | No :focus-visible rule of its own |
| 44px hit boundary | Yes: a ::after in Modal.module.css |
Accessibility and touch
Footer buttons are lg 36px.
Visible height 28px. The ::after boundary adds 8px above and below, so a gloved finger lands on a 44px target while the row keeps its density.
Rules and constraints
Use it for
- Confirm a destructive action, a short create form.
Avoid
- Never for long reading or browsing: that is a drawer.
Constraints
- Square container (structure, not a floating surface), 24px body padding, a docked footer.