Alpine's Morph plugin allows you to 'morph' an element on the page into the provided HTML template, all while preserving any browser or Alpine state within the 'morphed' element.
frameworkreactivedeclarativeplugin
https://alpinejs.dev/plugins/morph