Shadow partsBaseline · Widely available
The part and exportparts HTML attributes expose elements of a shadow DOM as named parts, which can be selected by the ::part() CSS pseudo-element for styling.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jul 28, 2020. Widely available since Jan 28, 2023.
Browser support
DesktopChrome
1–72Not supported
73+Supportedsince Mar 12, 2019
Current: 155Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154Firefox
1–71Not supported
72+Supportedsince Jan 7, 2020
Current: 157Safari
1–13Not supported
13.1+Supportedsince Mar 24, 2020
Current: 27MobileChrome Android
18–72Not supported
73+Supportedsince Mar 12, 2019
Current: 155Firefox Android
4–68Not supported
79+Supportedsince Jul 28, 2020
Current: 157Safari iOS
1–13Not supported
13.4+Supportedsince Mar 24, 2020
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: part.
Feature detection
JS · check before using
if ("exportparts" in HTMLElement.prototype) {
// the exportparts attribute is supported
}Documentation (MDN)
Specification
Sub-features
Support for each part of the feature (4). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| Element.part | 73 | 79 | 72 | 13.1 | 73 | 79 | 13.4 |
| part | 73 | 79 | 72 | 13.1 | 73 | 79 | 13.4 |
| exportparts | 73 | 79 | 72 | 13.1 | 73 | 79 | 13.4 |
| part | 73 | 79 | 72 | 13.1 | 73 | 79 | 13.4 |