Bibliothèque de composants UI modernes avec support HTMX optionnel
Project description
🚀 NexUI
NexUI is a UI component library for Django, optimized for HTMX and based on Tailwind CSS. It allows you to easily add interactive elements to your Django applications while benefiting from seamless integration with HTMX for AJAX request handling.
📌 Installation
Basic Installation
pip install nexui
Installation with HTMX support
If you plan to use HTMX with your components:
pip install nexui[htmx]
Or install HTMX separately later:
pip install django-htmx
Add nexui to the list of installed apps in settings.py:
INSTALLED_APPS = [
...
'nexui',
]
🎨 Features
✅ Reusable UI components for Django
🔥 Smooth integration with HTMX
🎨 Based on Tailwind CSS for a modern design
📦 Easy to install and use
🚀 Usage
Load NexUI tags in your Django templates
{% load nexui_tags %}
📖 Documentation
Check the full documentation here: Official Documentation
🔘 Button Component
The button component allows you to create customizable buttons with icons and HTMX interactions.
Available Options:
label: Button texttype: Button type (button,submit,reset)button_class: Custom CSS classesicon: Icon (supportsEmoji,Font Awesome, andUnicode)icon_type: Icon type (emoji,fa,unicode)icon_position: Icon position (left,right)icon_size: Icon sizeicon_color: Icon colordisabled: Disables the button (true)url_name: Django URL nameurl_params: Dynamic parameters for the Django URLattrs: AdditionalHTMLandHTMXattributes (_hx-*,id,style,data-*, etc.)
Button Usage Examples:
1️⃣ Simple Button
{% button label="Send" %}
2️⃣ Customized Simple Button
{% button label="Send" type="submit" button_class="bg-yellow-500 text-black" %}
3️⃣ Button with HTMX
{% button label="Send with HTMX" type="submit" button_class="bg-green-500" attrs="hx-post='/submit' hx-target='#result' hx-swap='innerHTML'" %}
4️⃣ Button with Dynamic URL
{% button label="Dynamic URL Params" type="submit" button_class="bg-blue-500 text-white" url_name="update-user" url_params="2, tomato" attrs="hx-confirm='Are you sure?' hx-target='#result' hx-swap='innerHTML'" %}
5️⃣ Button with Emojis
{% button label="Download" button_class="bg-green-500" icon="⬇️" icon_position="left" icon_size="lg" %}
📝 Input Component
The input component allows you to create customizable input fields with labels, icons, and HTMX integration.
Available Options:
type: Input type (text,password,email, etc.)name: Field nameid: Field ID (default is the same asname)value: Default valueplaceholder: Placeholder textcontainer_class: CSS classes for the main containerwrapper_class: CSS classes for the input wrapperlabel_class: CSS classes for the labelinput_class: CSS classes for the inputlabel: Label textrequired: Required field (true/false)disabled: Disables the field (true/false)readonly: Read-only field (true/false)icon: Icon (supportsEmoji,Font Awesome, andUnicode)icon_type: Icon type (fa,emoji)icon_position: Icon position (left,right)icon_size: Icon sizeicon_color: Icon colorurl_name: Django URL name forHTMXmethod: HTTP method for HTMX (postby default)attrs: AdditionalHTMLandHTMXattributes
Input Usage Examples:
1️⃣ Simple Input with Label and Icon
Simple Input
{% input_field %}
Simple Input with Label
{% input_field name="email" label="Email" %}
Simple Input with Label, Icon, and Customization
{% input_field name="email" label="Email" icon="fas fa-envelope" icon_type="fa" icon_position="left" placeholder="Email" %}
2️⃣ Password Input with Emoji
{% input_field type="password" icon="🔒" %}
3️⃣ Input with HTMX and Confirmation
{% input_field name="email" label="Email" icon="fas fa-envelope" icon_type="fa" url_name="submit-form" attrs='hx-confirm="Are you okay?"' %}
4️⃣ Input with Real-Time Search
{% input_field name="search" label="Search" icon="fas fa-search" icon_type="fa" icon_position="left" url_name="search_suggestions" attrs='hx-trigger="keyup changed delay:500ms" hx-target="#suggestions"' %}
5️⃣ Custom Styled Input
{% input_field container_class="py-2 flex items-center" name="email" label="Email" label_class="ml-2 text-gray-700 font-bold" input_class="w-44 pl-10 pr-3 py-2 rounded-md border border-gray-300" icon="fas fa-envelope" icon_type="fa" icon_position="left" %}
💡 Contribute
The project is currently in its early testing phase. We encourage interested users to provide feedback on the library.
If you want to contribute to NexUI or have suggestions:
Forkthe project 📌Testthe components and provide feedback 🛠️Createan issue to share your suggestions or report problems ✅
We cannot accept direct contributions at the moment, but your feedback is essential for NexUI's evolution.
🔗 Useful Links
- GitHub Repository 🖥️
- Report a Bug 🐞
- Django-HTMX ⚡
- Django-Tailwind 🎨
- HTMX ⚡
- Tailwind CSS 🎨
⚖️ License
This project is licensed under the MIT license. See the LICENSE file for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nexui-0.2.1.tar.gz.
File metadata
- Download URL: nexui-0.2.1.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0174b550243745d58c21fea4f4ec7aedd740f8ede84cc75f247e510b990acf2f
|
|
| MD5 |
d58fda753659ccf9c93b6e8c0f1d370c
|
|
| BLAKE2b-256 |
6e174fe4780d2bb294a3aa08870e9d3076e63935aca85fcffca138f62855a785
|
File details
Details for the file nexui-0.2.1-py3-none-any.whl.
File metadata
- Download URL: nexui-0.2.1-py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c1e0c5cd3aa4fe51503d9f7400e500e0b83efcde979afa3ef34fb6daf005ff0
|
|
| MD5 |
62e9b4e32e9b09e4203bcb30cb3cba02
|
|
| BLAKE2b-256 |
dbbe1f7d76997f73543479dd93ca82a5b9e62e65c8922486210b65638221b4da
|