Django, HTMX and - Building an Accordion component
In this video, we’ll build a simple accordion component, using Django, HTMX and
We’ll see how to load content with HTMX, and control which cards are shown in our accordion using .
Code is based off a previous tutorial - get the “django-forms-dynamic“ branch from this repository:
📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
00:31 Setup
01:02 Adding Alpine to project
03:28 Adding HTMX attributes to button
06:02 Building the accordion
07:28 Adding related modules to cards
08:53 Using prefetch_related method to avoid N 1 problem
10:04 Creating Alpine component
13:10 Showing multiple cards
18:22 Conditionally rendering icons
☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
▶️ Full Playlist:
𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog:
👾 Github:
2 views
10
3
2 years ago 00:21:14 2
3 Django+HTMX CRM: Создаем кастомный тег в HTMX. hx-custom=’title’
2 years ago 00:48:28 1
#2 Django+HTMX CRM: Подключаем HTMX в Django, Делаем навигацию страниц без перезагрузки.
3 years ago 00:23:07 6
Django, HTMX and - Modals and Forms
3 years ago 00:54:21 7
Modal forms with Django+HTMX
3 years ago 00:20:19 2
Django, HTMX and - Building an Accordion component
3 years ago 00:28:03 3
django-crispy-forms and HTMX integration #2 - User Registration and Login/Logout
3 years ago 00:09:19 2
Django and HTMX #14 - Trigger Filters for Conditionally Triggering Requests
3 years ago 00:19:59 5
Django and HTMX #6 (part 2) - Building a Sortable Drag and Drop Interface