Django, HTMX and Alpine.js - Building an Accordion component
In this video, we'll build a simple accordion component, using Django, HTMX and Alpine.js We'll see how to load content with HTMX, and control which cards are shown in our accordion using Alpine.js. Code is based off a previous tutorial - get the "django-forms-dynamic" branch from this repository: https://github.com/bugbytes-io/django-htmx-chained-dropdown ๐ ๐๐ต๐ฎ๐ฝ๐๐ฒ๐ฟ๐: 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: https://ko-fi.com/bugbytes โถ๏ธ Full Playlist: https://www.youtube.com/playlist?list=PL-2EBeDYMIbQTx0h0EQfw3BXjqRQTiX_c ๐ฆ๐ผ๐ฐ๐ถ๐ฎ๐น ๐ ๐ฒ๐ฑ๐ถ๐ฎ: ๐ Blog: https://www.bugbytes.io/posts/ ๐พ Github: https://github.com/bugbytes-io/django-htmx-chained-dropdown ๐ฆ Twitter: https://twitter.com/bugbytesio ๐ ๐๐๐ฟ๐๐ต๐ฒ๐ฟ ๐ฟ๐ฒ๐ฎ๐ฑ๐ถ๐ป๐ด ๐ฎ๐ป๐ฑ ๐ถ๐ป๐ณ๐ผ๐ฟ๐บ๐ฎ๐๐ถ๐ผ๐ป: Install Alpine: https://alpinejs.dev/essentials/installation HTML Unicode Icons: https://www.htmlsymbols.xyz/unicode #django #alpinejs #python
Download
0 formatsNo download links available.