The exportpartsglobal attribute re-exports CSS parts from a nested shadow tree so an outer page (or outer host) can style them with ::part(). Without it, parts stop at the inner shadow boundary.
Put part on the inner nodes, then list those names on the nested host with exportparts. Optionally rename with inner:outer mappings.
Composition helper.
Ideal when a wrapper component embeds another themed element and still wants a flat styling API.
Inner parts must exist first.
exportparts only forwards names that the nested tree actually exposes via part.
Syntax
HTML Syntax
syntax.html
<element exportparts="part[, inner:outer…]">
Comma-separated list. Same name forwards unchanged; inner:outer renames for consumers.
One line:exportparts bubbles nested CSS parts outward so theme authors can reach them with ::part().
Frequently Asked Questions
It forwards CSS parts from a nested shadow tree so they become addressable as parts of the outer host via ::part().
On the nested custom element (the inner host) that lives inside an outer shadow tree — or on any element that hosts nested parts you want to re-export.
A comma-separated list of mappings: innerPart or innerPart:outerPart to rename when exporting.
part only exposes nodes in that shadow tree. Nested shadow parts stay private until exportparts forwards them.
Yes. Use inner:outer syntax so consumers see a stable outer name.
Yes in modern Chromium, Firefox, and Safari alongside ::part support.