---
title: "What is Shadow DOM?"
term: "Shadow DOM"
description: "Shadow DOM is a web standard that lets a component attach its own hidden DOM tree to an element, keeping the component's markup and styles separate from the rest of the page so they do not clash."
url: "https://glossary.io/shadow-dom/"
published: "2026-11-22T20:44:18.718Z"
updated: "2026-11-22T20:44:18.718Z"
topics:
  - "Web development"
wikidata: "https://www.wikidata.org/wiki/Q11245915"
---

# What is Shadow DOM?

**Definition:** Shadow DOM is a web standard that lets a component attach its own hidden DOM tree to an element, keeping the component's markup and styles separate from the rest of the page so they do not clash.

A shadow root is attached to a host element with JavaScript or declared directly in HTML with declarative shadow DOM. Styles inside it apply only to its contents, and styles from the page do not leak in, apart from inherited properties, CSS custom properties and any parts the component chooses to expose. Slots let the page pass its own content into specific places inside the component.

Shadow DOM is one of the core technologies of [Web Components](https://glossary.io/web-components/), alongside custom elements and HTML templates, and browsers have long used it internally for built-in controls such as video players and form inputs. It prevents CSS conflicts in large sites and design systems, but it needs care with accessibility, forms and server-side rendering, since content inside shadow roots behaves differently from the regular [DOM](https://glossary.io/dom/).

## Shadow DOM resources

- [Official website](https://www.w3.org/TR/shadow-dom/)
- [Shadow DOM on Wikipedia](https://en.wikipedia.org/wiki/Shadow_DOM)

## Related terms

- [DOM](https://glossary.io/dom/)
- [Web Components](https://glossary.io/web-components/)

**Topic:** [Web development](https://glossary.io/topics/web-development/)

## Cite this definition

- APA: What is Shadow DOM? (2026, November 22). Glossary. https://glossary.io/shadow-dom/
- MLA: “What Is Shadow DOM?” Glossary, Coywolf, 22 Nov. 2026, glossary.io/shadow-dom/.
- Chicago: “What Is Shadow DOM?” Glossary. Coywolf. November 22, 2026. https://glossary.io/shadow-dom/.

Published November 22, 2026.
