Reusable Django UI components and tags with Tailwind support
Project description
🌸 Beautypy
Beautypy is a Django UI component library that provides pre-designed, reusable template tags for building modern, responsive UIs with Bootstrap 5. Create beautiful interfaces in minutes—no HTML or CSS required!
✨ Features
- ✅ Clean, responsive, accessible Bootstrap 5 components
- ⚡ Lightning-fast integration with Django templates
- 💡 Simple custom template tags:
{% Button %},{% Alert %},{% Navbar %},{% Tooltip %}, and more - ☕ Support development via Buy Me a Coffee
📦 Installation
pip install beautypy # (Test version: see below)
Currently under testing phase. Install the test version with:
pip install -i https://test.pypi.org/simple/ beautypy
🎨 Bootstrap 5 Integration
Beautypy uses Bootstrap 5 for styling. You can include Bootstrap in your project via following this setup:
⚙️ Django Setup
- Add to INSTALLED_APPS
INSTALLED_APPS = [
...
'beautypy',
]
- Templates Context Processor Make sure your TEMPLATES setting includes:
'OPTIONS': {
'context_processors': [
...
'django.template.context_processors.request',
],
}
- Load Beautypy Tags In your templates top of your html page:
{% load Components %}
- Load Bootstrap CSS/JS (if not already loaded globally)
{% LoadBeautypyCSS %} {# Loads Bootstrap CSS #}
{% LoadBeautypyJS %} {# Loads Bootstrap JS #}
🧩 Components & Template Tags
1. {% LoadBeautypyCSS %}
Loads Bootstrap CSS. Uses local static if available, otherwise falls back to CDN.
Usage:
{% LoadBeautypyCSS %}
2. {% LoadBeautypyJS %}
Loads Bootstrap JS. Uses local static if available, otherwise falls back to CDN.
Usage:
{% LoadBeautypyJS %}
3. {% Button %}
Renders a Bootstrap-styled button.
Props:
label(required): Button texttype: Button type (button,submit, etc.)variant: Bootstrap color variant (primary,secondary,success,danger,warning,info)css_class: Additional classestag_id: Optional id
Usage:
{% Button label="Submit" type="submit" variant="primary" %}
4. {% Link %}
Renders a Bootstrap-styled link (anchor).
Props:
url(required): Hreflabel(required): Link textcss_class: Additional classes (default:btn btn-link)tag_id: Optional id
Usage:
{% Link url="/home" label="Home" css_class="btn btn-primary" %}
5. {% Alert %}
Renders a Bootstrap-styled alert box.
Props:
message(required): Alert textalert_type:info,success,warning,errorcss_class: Additional classes (default:alert)tag_id: Optional id
Usage:
{% Alert message="Success!" alert_type="success" %}
6. {% InputField %}
Renders a Bootstrap input field.
Props:
name(required)value: Default valueinput_type: Input type (default:text)css_class: Additional classes (default:form-control)tag_id: Optional id
Usage:
{% InputField name="email" input_type="email" css_class="form-control" %}
7. {% InputLabel %}
Renders a Bootstrap label for an input.
Props:
name(required): For attributelabel_text(required): Label textcss_class: Additional classes (default:form-label)tag_id: Optional id (default:label)
Usage:
{% InputLabel name="email" label_text="Your Email" %}
8. {% FormGroup %}
Groups a label and input together in a Bootstrap form group.
Props:
label(required): Label textinput_field(required): Input field (rendered separately)
Usage:
{% FormGroup label="email" input_field=input_field %}
9. {% Toast %}
Renders a Bootstrap-styled toast notification.
Props:
message(required)toast_type:info,success,warning,errortag_id: Optional id
Usage:
{% Toast message="Operation successful!" toast_type="success" %}
10. Block Tags
These tags wrap content in Bootstrap containers/sections/footers/navbars, etc.
Section
{% Section title="Section Title" css_class="mb-4" tag_id="section1" %}
<!-- Content -->
{% endSection %}
Container
{% Container css_class="container my-4" tag_id="main-container" %}
<!-- Content -->
{% endContainer %}
Footer
{% Footer css_class="text-center text-muted py-3" tag_id="footer" %}
© 2025 Beautypy
{% endFooter %}
Navbar
{% Navbar css_class="navbar navbar-expand-lg navbar-dark bg-primary p-4" tag_id="main-navbar" %}
<!-- Logo / Nav links / Buttons -->
{% endNav %}
Tooltip
{% Tooltip title="Helpful info!" css_class="d-inline-block" %}
<button class="btn btn-secondary">Hover me</button>
{% endTooltip %}
Accordion
{% Accordion title="Click to Expand" css_class="accordion" tag_id="accordion1" %}
<p>This content is toggled.</p>
{% endAccordion %}
📷 Example Template
{% load Components %}
<!DOCTYPE html>
<html>
<head>
<title>Beautypy Example</title>
{% LoadBeautypyCSS %}
</head>
<body>
{% Navbar css_class="navbar navbar-expand-lg navbar-dark bg-primary p-4" %}
<!-- Content -->
{% endNav %}
{% Section title="Alerts" %}
{% Alert message="Success!" alert_type="success" %}
{% endSection %}
{% Footer css_class="text-center text-muted py-3" %}
© 2025 Beautypy
{% endFooter %}
{% LoadBeautypyJS %}
</body>
</html>
🤝 Contributing
- Fork this repository
- Create your feature branch:
git checkout -b feature/my-component
- Commit your changes:
git commit -m 'Add my new component'
- Push to the branch:
git push origin feature/my-component
- Open a pull request
💖 Support
Beautypy is open-source. If you like the project, consider supporting it via Buy Me a Coffee.
🔗 License
MIT License © 2025 webdevavi96 | Avinash
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 beautypy-1.0.tar.gz.
File metadata
- Download URL: beautypy-1.0.tar.gz
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e530e5633dfb481d26213ab8aa482f76784ccb29eda39545bf4c5420618b0b63
|
|
| MD5 |
1086c83e2272d8d45b77f18d04c94f76
|
|
| BLAKE2b-256 |
2ada67793881957aaf1af6b3d0987f1d8867cdfb4975ef5db2f654c065e57312
|
File details
Details for the file beautypy-1.0-py3-none-any.whl.
File metadata
- Download URL: beautypy-1.0-py3-none-any.whl
- Upload date:
- Size: 2.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b78a0497a3fcbfb0caf7af91cf6412482e36580c2891fda62ba9124cc3c23ec
|
|
| MD5 |
e45224c17eb26b50a5e87c97cdeaaf48
|
|
| BLAKE2b-256 |
e2a1832982b2c2821c3a6244fdfedcea6e2f82978d77a11f43257dff376dec9d
|