A custom element uses the static observedAttributes getter to name the HTML attributes it watches. When one of those attributes changes, attributeChangedCallback receives its name and new value. Listing an attribute is only the first step: the callback must decide how to update the component. section 3.10
A radio group that responds to markup
A <radio-group> can accept labels, legend, name, value, and values as attributes. Its class returns those five names from static get observedAttributes(). In attributeChangedCallback, it assigns the new value to the matching property. Once connected, changes other than value trigger render(); changing value instead uses the value setter to update the selected radio button without replacing the whole DOM. section 3.10
Initial attributes also need care. The radio group waits until connected before re-rendering, avoiding a render for each initial attribute value. Its connectedCallback reads the supported attributes and performs the initial render. section 3.10
Keep attributes and properties in sync
A <sortable-table> observes string-valued headings and properties, but not data, which holds an array of objects. Its attributeChangedCallback routes attribute changes through the corresponding property setters. A setter can update the attribute and the displayed table; checking whether the value actually changed prevents that synchronization from recurring indefinitely. section 4.2.8

