Problem/Motivation

HTMX 4 processes a custom tag that is meant to enclose an HTML fragment rendered for insertion into an existing page.

<hx-partial hx-target="#messages" hx-swap="beforeend">
    <div class="message">New message content</div>
</hx-partial>
tags can have the following attributes:

hx-target - CSS selector for where to place content
id - Shorthand alternative to hx-target. Targets the element with that ID (e.g. targets #messages)
hx-swap - Optional. Swap style (defaults to innerHTML)

Upstream documentation: hx-partial.

Proposed resolution

Create a render element plugin for hx-partial with variables for content, target and swap.

Remaining tasks

User interface changes

none

Introduced terminology

none

API changes

New render element

Data model changes

none

Release notes snippet

Comments

fathershawn created an issue.