In this video, we will see how to create a modal using TailwindCSS styles, and using Alpine JS to control the modal’s visibility using different techniques.
We’ll see how to submit a form within the modal using HTMX, and how to display feedback on the page after submission.
Modals are windows that appear on a UI and are designed to draw the user’s attention to an important action. We’ll show the basics of how to create a modal system with Alpine.
In this video, we’ll also show a couple of event modification techniques with Alpine, such as the “outside“ modifier on a click event, and the “debounce“ modifier.
📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
02:00 Creating a Complaint Model
02:54 Creating a Complaint Form
04:05 Adding Form to View/Template
06:10 Creating an Alpine Component
07:50 Closing Modal with X Button
08:34 Closing Modal on Outside Click
09:57 Rendering Form Class Fields
12:47 Submitting Form with HTMX
16:23 Creating Success/Failure partials
18:28 Adding form validation method
20:44 Closing Modal after Submit (Alpine debounce modifier)
☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
▶️ Full Playlist:
𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog:
👾 Github:
🐦 Twitter:
📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
TailwindCSS modal:
docs:
Alpine modifiers: #modifiers
#django #alpinejs #python #tailwindcss
6 views
2
2
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