Skip to main content

A Reusable RTL Django Sidebar App

Project description

Micro Sidebar - A Reusable RTL Django Sidebar App

PyPI version

RTL lightweight, reusable django app that provides a dynamic sidebar for your django projects.

Requirements

  • Django: >= 5.1
  • Bootstrap: 5 (Required for consistent styling)

Installation

  1. Install:

    pip install micro-sidebar
    # OR
    pip install git+https://github.com/debeski/micro-sidebar.git
    
  2. Add to INSTALLED_APPS: In your settings.py:

    INSTALLED_APPS = [
        ...
        'sidebar',
        ...
    ]
    
  3. Configure URLs: In your project's urls.py:

    from django.urls import path, include
    
    urlpatterns = [
        ...
        path('sidebar/', include('sidebar.urls')),
        ...
    ]
    

Customization

Override Default Menu

The sidebar uses a block-based template system. To define your own menu items:

  1. Create a new template (e.g., templates/sidebar_menu.html).
  2. Extend sidebar/main.html.
  3. Override the {% block items %}.

Example sidebar_menu.html:

{% extends "sidebar/main.html" %}

{% block items %}
<a href="{% url 'home' %}" class="list-group-item list-group-item-action">
    <i class="bi bi-house me-2" style="font-size: 24px;"></i>
    <span>Home</span>
</a>
<a href="{% url 'settings' %}" class="list-group-item list-group-item-action">
    <i class="bi bi-gear me-2" style="font-size: 24px;"></i>
    <span>Settings</span>
</a>
{% endblock %}

Then, include your custom template in base.html:

{% include "sidebar_menu.html" %}

Positioning

The sidebar is sticky by default. If your app has a top navigation bar (titlebar), the sidebar will automatically adjust its position below it on small screens. If no titlebar is detected, it will stick to the top of the viewport.

RTL / LTR Support

This sidebar is primarily designed for RTL (Right-to-Left) interfaces (e.g., Arabic). While it may theoretically work in LTR environments if standard Bootstrap files are used instead of RTL versions, this has not been fully tested.

Future updates are planned to support dynamic language switching between RTL and LTR.

Version History

Version Changes
v1.0.0 Initial Release.
v1.0.1 Fixed titlebar positioning bug causing overlap/gaps.
v1.0.2 Improved documentation clarity and added usage instructions.
v1.1.0 Renamed content.html to main.html for clarity. Refactored to use {% block items %} for easier extension.
v1.2.0 New Theme Implementation: Redesigned UI with rounded pill-shaped items, tactile micro-animations, and a refined color palette. Improved responsiveness with dynamic top-offset calculations and inline FOUC fixes for small screens. Fixed tooltip stickiness bug.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

micro_sidebar-1.2.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

micro_sidebar-1.2.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file micro_sidebar-1.2.0.tar.gz.

File metadata

  • Download URL: micro_sidebar-1.2.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for micro_sidebar-1.2.0.tar.gz
Algorithm Hash digest
SHA256 6ab7a6182788a40b74d2ccebb93417847154c0b070d5f87484f7d4cf6d551334
MD5 ae0d83c094bee346b0c203d6d8af3f97
BLAKE2b-256 b650dba8efefe850d5f296548185316c6aa5cad6eeebcf624bd5a34a5f5113a3

See more details on using hashes here.

File details

Details for the file micro_sidebar-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: micro_sidebar-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for micro_sidebar-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e244fd18ef5e93285da6c622dbce647d43512e6368d5219a9517646941c09381
MD5 242a2c73023622834a297e27d2256393
BLAKE2b-256 d4131d01a11b84d71915e276514a3e7fd2e0ca6bece8516a263026d200a5d353

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page