Banner

Message inline contextuel (callout / alerte) dans le flux de la page : info, succès, avertissement, erreur. 6 variantes alignées sur le badge. Statique par défaut — région live en opt-in pour les messages dynamiques. Inline contextual message (callout / alert) in the page flow: info, success, warning, error. 6 variants aligned with badge. Static by default — opt-in live region for dynamic messages.

VariantesVariants

NeutreNeutral Message neutre informatif.Neutral informational message. AgenticaAgentica Highlight de marque ou contribution.Brand highlight or contribution. InformationInformation Ce composant est en lecture seule.This component is read-only. EnregistréSaved Vos modifications ont été sauvegardées.Your changes have been saved. AttentionWarning Cette action affectera 3 fichiers liés.This action will affect 3 linked files. ErreurError Impossible de contacter le serveur.Could not reach the server.

Règles absoluesAbsolute rules

Tokens de composantComponent tokens

Token CSSRéférenceReferenceValeurValue
--agtc-component-banner-info-accentsemantic.color.feedback.info#0d74ce
--agtc-component-banner-success-accentsemantic.color.feedback.success#18794e
--agtc-component-banner-warning-accentprimitive.color.orange.11
--agtc-component-banner-danger-accentsemantic.color.feedback.danger#ce2c31
--agtc-component-banner-brand-accentsemantic.color.brand.primary#12a594
--agtc-component-banner-heading-textsemantic.color.text.primary#202020
--agtc-component-banner-body-textsemantic.color.text.secondary#646464
--agtc-component-banner-radiussemantic.radius.card10px
--agtc-component-banner-padding-xprimitive.space.520px

AccessibilitéAccessibility

ImplémentationImplementation

<agtc-banner variant="warning" heading="Attention">
  Cette action affectera 3 fichiers liés.This action will affect 3 linked files.
</agtc-banner>

<!-- Avec actions + dismissible -->
<agtc-banner variant="brand" heading="Contribuer" dismissible>
  Ce système est ouvert aux contributions.This system welcomes contributions.
  <span slot="actions"><a href="…">Voir sur GitHub →View on GitHub →</a></span>
</agtc-banner>

<!-- Notification dynamique (insérée par JS) -->
<agtc-banner variant="danger" live="assertive" heading="Erreur">…</agtc-banner>

DOs et DON'TsDOs and DON'Ts

À faireDo

  • Choisir la variante par sévérité (success/warning/danger)Choose variant by severity (success/warning/danger)
  • Garder les erreurs persistantes (pas d'auto-dismiss)Keep errors persistent (no auto-dismiss)
  • Mettre live uniquement sur les messages insérés dynamiquementSet live only on dynamically inserted messages

À éviterDon't

  • role="alert" sur un banner statique de pagerole="alert" on a static page banner
  • Un banner pour ce qui devrait être un toast ou une modaleA banner for what should be a toast or modal
  • La sévérité par la couleur seuleSeverity by color alone

UX Patterns Reference

Patterns approved via the ux-pattern-review workflow (ADR-036/042). Decision: N1–N9 all approved.

PatternSourceAppliedJustification
Semantic variants (6)NN/gAligned with agtc-badge
Meaning never conveyed by color alone (icon + AT text)NN/gHidden severity prefix
Icon per variantNN/gOverridable, no-icon possible
Static by default (no live region)MDN — status rolelive="off" by default
Assertive role="alert" used sparinglyA11Y CollectiveVia live="assertive"
Accessible close button, no focus trapMDN — alert roledismissible + dismiss event
Heading + body + action zoneNN/gheading + slot + slot="actions"
Left accent border + subtle backgroundDashboardReuses the contribution-banner style
No auto-dismiss for critical messagesNN/gDocumented guidance (persistent danger/warning)
Contribuer à ce projet Contribute to this project

Ce système est ouvert aux contributions — tokens, composants, décisions architecturales, corrections d'accessibilité ou documentation. Toute amélioration est bienvenue. This system welcomes contributions — tokens, components, architectural decisions, accessibility fixes, or documentation. Every improvement counts.

Voir sur GitHub View on GitHub