Backdrop
A backdrop is a semi-transparent overlay that dims the content behind a modal or popover, focusing user attention on the overlaid content.
Ready to use
A backdrop is a layered interface element that appears above the main content to provide contextual information or interaction. It temporarily interrupts the user flow to deliver focused content such as dialogs, tooltips, or menus, and acts as the visual layer that supports focus trapping and content containers above it. The component is fully responsive and intentionally designed to be used across all viewports — mobile, tablet and desktop — with no alternative versions required.
Anatomy
Section titled “Anatomy”- Backdrop
When to use it
Section titled “When to use it”Use the backdrop when:
- A critical decision interrupts the user’s flow (confirmations, authentications).
- Contextual actions like menus or dropdowns need focus isolation.
- A focused task — a side panel for editing or a form — needs to keep the user’s attention.
- You want to avoid taking the user out of their navigation flow, allowing alternative flows such as inline editing or quick previews.
Avoid the backdrop when:
- The message is passive information such as a tooltip.
- An inline alternative would fit the page just as well.
- Backdrops would start to stack or overlap one another.
- Adding the layer would compromise accessibility — for example by trapping focus or blocking keyboard navigation.
Properties
Section titled “Properties”Shape
The backdrop adapts to the screen in a full-size form, covering the underlying surface so the foreground layer reads as the only interactive region.
Color
The fill remains at 55–65% opacity and resolves through the surface dim tokens, so brand consistency holds in both light and dark themes without manual editing.
Interaction
The backdrop itself isn’t focusable and contains no interactive elements — those live in the modal, drawer, or tooltip layered above. It’s marked aria-hidden="true" so assistive tech ignores it.
Platform considerations
Section titled “Platform considerations”Desktop
The backdrop covers the full viewport and isolates focus to the foreground layer. Keep the dimming consistent so the visual hierarchy between the page and the overlay stays clear.
Tablet
Same coverage as desktop. Ensure the foreground container stays large enough that touch targets within it remain comfortable.
Mobile
On mobile the foreground layer often promotes to a bottom sheet. The backdrop still covers everything outside that sheet so the user’s focus remains on the active task.
Best practices
Section titled “Best practices”Treat the backdrop as a focus-management tool, not just decoration.
Do
Use the backdrop to interrupt the flow for critical tasks (confirmations, authentication, blocking actions), trap focus within the layered foreground and return focus to the trigger on close, and keep the dimming consistent with the surface tokens so contrast stays predictable.
Don't
Don’t use a backdrop for passive information or low-urgency alerts (a toast or inline hint fits better), don’t stack multiple backdrops at once (progressive disclosure handles that better), and don’t lean on it as a container for full pages or persistent UI.
Content guidelines
Section titled “Content guidelines”The backdrop carries no copy of its own — content lives in the layered surface above it. Make sure that surface speaks to the task it’s interrupting: a confirmation dialog needs a clear title and action verbs; a side panel needs the same labels and helper text it would use inline.
Styles
Section titled “Styles”<div class="tng-backdrop z-behind"></div><button class="tng-icon-button is-ghost on-contrast | p-absolute at-top-right inset-lg" aria-label="Close"> <i class="tng-icon icon-close" aria-hidden="true"></i></button>A backdrop is the dimming layer behind an overlay — a modal, drawer, or popover — so it has no WAI-ARIA interaction pattern of its own: it is purely decorative, and the overlay it accompanies owns the semantics, following the WAI-ARIA APG Dialog (Modal) pattern. An accessible backdrop stays out of the accessibility tree, lets the overlay above it trap focus and carry the accessible name, and makes the page behind inert — so a keyboard or screen-reader user is never stranded in content the dimming has visually switched off. Together with its overlay it meets WCAG 2.1 AA.
For designers
Section titled “For designers”- Any affordance layered over the backdrop — typically the close button — and the overlaid content must maintain accessible contrast against the dimmed surface. Source: WCAG 1.4.3 Contrast (Minimum).
- The dimming must never be the only signal that the page behind is inactive — the overlay’s presence and the trapped focus already carry that meaning; don’t rely on the backdrop’s tint alone. Source: WCAG 1.4.1 Use of Color.
- Focus styles on the close affordance must stay visible against the dimmed backdrop, meet contrast requirements, and be clearly distinguishable from hover. Source: WCAG 2.4.7 Focus Visible.
- Use semantic colour tokens (e.g.
foreground/neutral/default) rather than fixed values, so the component adapts correctly across themes and surfaces.
For developers
Section titled “For developers”The backdrop is purely decorative, so keep it out of the accessibility tree: a standalone <div class="tng-backdrop"> carries no role and is ignored automatically, and when the overlay is a native <dialog> or uses the popover attribute, the browser-generated ::backdrop pseudo-element is never exposed to assistive technology either. The semantics live on the overlay the backdrop accompanies — that surface carries role="dialog", traps focus while it is open, and owns the accessible name — not on the backdrop layer, which must never hold focus or interactive content. While the overlay is open, set inert on the page content behind so focus and pointer events can’t escape behind the dimming, and respect prefers-reduced-motion by dropping the fade animation for users who ask for less motion. The backdrop layer, the dialog it accompanies, and the close affordance each get their role, name, and state in the Labelling elements section below.
Labelling elements
Section titled “Labelling elements”Give every element the role, name, and state assistive technology needs.
Backdrop element
.tng-backdrop is decorative — it takes no role and needs no accessible name, and a standalone <div class="tng-backdrop"> is ignored by assistive technology automatically. When the overlay is a native <dialog> or uses the popover attribute, the browser’s ::backdrop pseudo-element replaces it and is likewise never exposed. Never add interactive content or tabindex to the backdrop layer.
Dialog / overlay
The overlay the backdrop dims for — usually a modal. It, not the backdrop, carries the semantics: role="dialog" (implied by a native <dialog> opened with showModal(), along with aria-modal="true"), named with aria-labelledby pointing to its visible title, or aria-label when there is none. Focus is trapped inside it while it is open and returns to the trigger on close.
Close affordance
The close button overlaying the backdrop. Its accessible name must read as “Close” — from visible text, or aria-label="Close" when it is icon-only, with the close icon marked aria-hidden="true" so it is not announced twice. Set inert on the page content behind while the overlay is open so this control and the overlay stay the only reachable elements.
Source: WCAG 4.1.2 Name, Role, Value.