<my-ce name="Initial Name"></my-ce>

<script>
  class MyCe extends HTMLElement {
    constructor() {
      super()
      this.textContent = 'Hello, World!'
    }
    static get observedAttributes() {
      return ['name']
    }

    attributeChangedCallback(name, oldValue, newValue) {
      if (name === 'name') {
        this.textContent = newValue
      }
    }
  }
  customElements.define('my-ce', MyCe)
</script>

Done 🎉

Now you can set name attribute with <my-ce name="New Name"></my-ce> and see the text content change.