Global Attributes
HTML part attribute
Names shadow DOM elements that may be styled from outside using ::part(). The containing component controls which parts are exposed. Applicability: global HTML attribute, subject to element-specific restrictions and browser support.
Formal Syntax & Structure
html syntaxhtml
part="label"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| part | space-separated part names | Names shadow DOM elements that may be styled from outside using ::part(). The containing component controls which parts are exposed. |
Working Example
Example Snippethtml
<template shadowrootmode="open"> <span part="label">Status</span></template>Browser Compatibility
Minimum supported versions across modern rendering engines
Widely Available
Chrome
73
Yes
Firefox
72
Yes
Safari
13.1
Yes
Checked desktop BCD snapshot: global part attribute. Versions denote the recorded start of support (≤ means at least that early), not a guarantee of all behavior. Unresolved mirror and preview rows omitted.
CSS Shadow Parts