Element.part is a read-onlyDOMTokenList of the element’s part identifiers (MDN). It reflects the HTML part attribute and exposes nodes for CSS ::part() across a shadow boundary.
Read the notes below before you get or set this property. Prefer feature detection when support is limited.
Syntax
Use el.part. Start with this line.
JavaScript
element.part
Call
What it does
element.part
Primary signature.
Built into the browser. Read or assign el.part — no import required.
Library declarations
JavaScript
element.part
Parameters
This member has no parameters beyond those shown in the signature.
Append into the shadow tree. The part is now exposable to CSS.
Read from JS with part.value / contains (CSS would use ::part()).
Compatibility
Browser Support
Element.part is Baseline Widely available (MDN: since July 2020). Safe across modern evergreen browsers.
✓ Baseline · Widely available
Element.part
DOMTokenList of part identifiers — expose shadow nodes for CSS ::part().
96%Widely available
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
partExcellent
Bottom line: Safe for production component styling. Pair with attachShadow and ::part() in CSS.
Frequently Asked Questions
It returns a DOMTokenList of the element's CSS part identifiers, reflecting the part HTML attribute. Those names let external CSS style shadow DOM internals via ::part().
No. MDN marks Element.part as Baseline Widely available (since July 2020). It is not Deprecated, Experimental, or Non-standard.
Yes. You cannot replace the DOMTokenList object, but you can use add(), remove(), replace(), and toggle(), or assign a string to el.part (sets its value).
A CSS pseudo-element that selects elements inside a shadow tree exposed with the part attribute — for example my-element::part(tab).
You can set part on any element and read it in JS. ::part() styling only applies across a shadow boundary.
part names parts on elements in a shadow tree. exportparts on the host re-exports nested part names so outer CSS can reach deeper shadows.