gemini-2.5-flash-preview-09-2025| input-price: 0.3 output-price: 2.5 max-context-length: 128_000 (cost: $0.005) Β· Anfrage: 2025-09-27T09:25:57.399038
Generated by rs-summarizer Version unbekannt
Abstract:
This Reddit thread, posted in r/htmx, addresses a common question regarding the framework's use of custom attributes (like hx-post) without the standard HTML data- prefix, a practice used by competitors like Hotwire. The discussion clarifies that while HTMX permits the use of the data- prefix as an option for user preference, technically, any attribute containing a dash is permitted for custom use. Furthermore, the conversation introduces "Datastar," a related, HTMX-inspired framework that explicitly adheres to the data- convention and expands functionality with features like Server-Sent Events (SSE).
HTMX Attribute Naming Convention Discussion
data- prefix for its attributes, noting that standard HTML practice recommends this prefix to avoid conflicts with future native HTML attributes, citing frameworks like Hotwire as examples that follow this convention.data- prefix can be used optionally by the user if preferred (e.g., <a data-hx-post="/click">Click Me!</a>).data- prefix, explaining that while any attribute with a dash is acceptable for custom use, data- is special because it allows developers to access the attribute easily using the JavaScript dataset property.data-star) which was inspired by HTMX and explicitly uses the data- prefix.