Skip to main content

A reusable Django sidebar for Web Apps

Project description

Micro Sidebar

A reusable RTL Django sidebar app for Web Apps.

Requirements

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

Installation

  1. Install the package:

    pip install micro-sidebar
    
  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')),
        ...
    ]
    
  4. Add to your Base Template: In your base.html (or equivalent), include the sidebar. It is designed to sit to the right of your main content.

    Example structure using Flexbox:

    <body>
        <div class="d-flex">
            <!-- Sidebar -->
            {% include "sidebar/content.html" %}
    
            <!-- Main Content -->
            <div class="flex-grow-1">
                {% block content %}{% endblock %}
            </div>
        </div>
        
        <!-- Bootstrap JS (Required) -->
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    </body>
    

Customization

Overriding Content

The sidebar comes with a default template. To customize the links and content, create a file named content.html inside templates/sidebar/ in your project's templates directory.

Path: your_project/templates/sidebar/content.html

The default sidebar logic expects specific classes like .list-group-item and .accordion-item for the collapsible features to work correctly with the provided JS.

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.

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.0.2.tar.gz (6.8 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.0.2-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for micro_sidebar-1.0.2.tar.gz
Algorithm Hash digest
SHA256 4c3612e8edb55fd1935f02fc1143b7d0f0114ea6973796fd11127218d6358b46
MD5 5eb4a98fa0d1bd87afe4fed85bce6620
BLAKE2b-256 9457def10d7696cc8762c0c56368dd23a6574166814f137ed4bd062486945315

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for micro_sidebar-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 df18616143fbfb81fb186dd1c49d2253c96192f414b6ef2344cd59077c766bd6
MD5 447fb21491cf9d13fd63f7cddae9dba4
BLAKE2b-256 ad31d2bda28a8100963ef94c4fc690db6c388f8633bf94216bd93650cc564856

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