Use HTMX for general UI navigation #9064

Closed
opened 2025-12-29 20:45:00 +01:00 by adam · 3 comments
Owner

Originally created by @jeremystretch on GitHub (Jan 8, 2024).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.7.0

Feature type

New functionality

Proposed functionality

NetBox has employed HTMX in several areas of the UI for a while now, to improve responsiveness. These areas include:

  • Sorting/filtering lists of objects
  • Re-rendering object edit forms
  • Providing deletion confirmation dialogs

This proposal seeks to extend the use of HTMX across the entire application, leveraging it for nearly all views. For instance, clicking a navigation menu link would replace only the main portion of the page with new content, avoiding a full page refresh.

Use case

HTMX strikes a very natural balance between traditional full-page rendering and reactive SPA frameworks, returning only the portion of HTML content necessary to update the page. This provides a much more seamless user experience, and can significantly reduce page load times. These gains can be achieved with relatively little backend work, leveraging existing HTML templates.

Database changes

None

External dependencies

We'll use the django-htmx package per #14735.

Originally created by @jeremystretch on GitHub (Jan 8, 2024). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.7.0 ### Feature type New functionality ### Proposed functionality NetBox has employed [HTMX](https://htmx.org/) in several areas of the UI for a while now, to improve responsiveness. These areas include: * Sorting/filtering lists of objects * Re-rendering object edit forms * Providing deletion confirmation dialogs This proposal seeks to extend the use of HTMX across the entire application, leveraging it for nearly all views. For instance, clicking a navigation menu link would replace only the main portion of the page with new content, avoiding a full page refresh. ### Use case HTMX strikes a very natural balance between traditional full-page rendering and reactive SPA frameworks, returning only the portion of HTML content necessary to update the page. This provides a much more seamless user experience, and can significantly reduce page load times. These gains can be achieved with relatively little backend work, leveraging existing HTML templates. ### Database changes None ### External dependencies We'll use the [`django-htmx` package](https://github.com/adamchainz/django-htmx) per #14735.
adam added the status: acceptedtype: feature labels 2025-12-29 20:45:00 +01:00
adam closed this issue 2025-12-29 20:45:00 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jan 8, 2024):

Marking this as blocked by #14735 for now.

@jeremystretch commented on GitHub (Jan 8, 2024): Marking this as blocked by #14735 for now.
Author
Owner

@jeremystretch commented on GitHub (Feb 1, 2024):

I'm planning a phased approach to implementing HTMX.

Phase 1 (v4.0)

  • Minimally extend existing template structure to add HTMX-specific containers (e.g. for page content)
  • "Boost" links in nav menu & page (exclude footer)
  • Employ hx-select to swap in only the relevant HTML content from an HTTP response
  • Protect embedded tables from replacing the entire page content on load

Phase 2 (v4.1+)

  • Rearchitect views & templates to support true partial rendering

This approach should allow us to implement HTMX application-wide with a relatively light touch, while retaining full HTML rendering by default for backward compatibility.

@jeremystretch commented on GitHub (Feb 1, 2024): I'm planning a phased approach to implementing HTMX. #### Phase 1 (v4.0) - Minimally extend existing template structure to add HTMX-specific containers (e.g. for page content) - "[Boost](https://htmx.org/attributes/hx-boost/)" links in nav menu & page (exclude footer) - Employ [`hx-select`](https://htmx.org/attributes/hx-select/) to swap in only the relevant HTML content from an HTTP response - Protect embedded tables from replacing the entire page content on load #### Phase 2 (v4.1+) - Rearchitect views & templates to support true partial rendering This approach should allow us to implement HTMX application-wide with a relatively light touch, while retaining full HTML rendering by default for backward compatibility.
Author
Owner

@jeremystretch commented on GitHub (Feb 23, 2024):

Here's a great, quick intro to HTMX for the uninitiated: https://youtu.be/r-GSGH2RxJs

@jeremystretch commented on GitHub (Feb 23, 2024): Here's a great, quick intro to HTMX for the uninitiated: https://youtu.be/r-GSGH2RxJs
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9064