Persistent feedback with explicit announcement policy and optional dismissal.
<script type="module" src="/assets/components/message/qds-message.js"></script>
<qds-message id="message-info" severity="info" heading="Reporting period">Submit updates by the end of the week.<a slot="actions" href="#message-states">Review states</a></qds-message>
| API | Contract |
|---|---|
severity |
neutral (default), info, success, warning, error. |
heading / title slot |
Optional visible title. |
| Default / actions slots | Body and associated actions. |
announcement |
off (default), polite (status), or assertive (alert). |
dismissible |
Boolean; enables the native dismiss button. |
dismiss-label |
Accessible action name, default Dismiss message. |
dismiss() |
Returns true and sets hidden when dismissal is accepted. |
Static errors are not automatically alerts. Create a live region before updating its content; use assertive announcements only for urgent changes. Existing semantic tokens control the border; primary text on the themed surface maintains readability without conveying meaning through color alone.
Cancelable bubbling/composed qds-dismiss carries { component }. Prevent it to keep the message visible; set hidden=false to show a dismissed message again. If dismissal removes the focused control, the application should move focus to the logical next action. CSS parts: message, dismiss.
The component uses native Web Components with an open shadow root, existing QDS CSS custom properties, and no framework runtime. Base CSS is loaded once. Set data-theme="dark" or data-theme="light" on a containing element or use the documentation toolbar. Event listeners and observers are removed on disconnect; reconnecting is supported.
Interactive demo ยท P0 contracts and verification
Generated Quangular wrappers expose the same attributes/properties and events using the q-qds- prefix. For child composition, use the documented native child elements inside the wrapper when the native parent requires direct children. See the Quangular catalog for generated type signatures.