Skip to main content

Bootstrap components for django-components

Project description

Django Components Bootstrap

Bootstrap 5 components for Django with React-Bootstrap API parity.

Installation

pip install django-components-bootstrap

Add to your Django settings:

INSTALLED_APPS = [
    ...
    "django_components",
    "django_components_bootstrap",
]

Quick Start

{% load component_tags %}

{% component "Button" variant="primary" %}
    Click me!
{% endcomponent %}

{% component "Alert" variant="success" dismissible=True %}
    <strong>Success!</strong> Your changes have been saved.
{% endcomponent %}

Configuration

By default, all Bootstrap components are automatically registered when the app loads. To disable auto-registration:

DJANGO_COMPONENTS_BOOTSTRAP = {
    "AUTO_REGISTER": False,
}

When auto-registration is disabled, you can manually import and register components:

from django_components import registry
from django_components_bootstrap.components.bootstrap5 import Button, Alert

registry.register("Button", Button)
registry.register("MyAlert", Alert)  # Register under a custom name

Documentation

Full documentation with examples: https://joeyjurjens.github.io/django-components-bootstrap/

Development

Setup

git clone https://github.com/joeyjurjens/django-components-bootstrap.git
cd django-components-bootstrap
uv sync --all-extras

Running Tests

pytest

Building Documentation

cd docs
python generate_docs.py
mkdocs serve

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

django_components_bootstrap-0.1.0.tar.gz (106.8 kB view details)

Uploaded Source

Built Distribution

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

django_components_bootstrap-0.1.0-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

Details for the file django_components_bootstrap-0.1.0.tar.gz.

File metadata

File hashes

Hashes for django_components_bootstrap-0.1.0.tar.gz
Algorithm Hash digest
SHA256 20e01394a296c3a75bd912dee36da403518c0f83e1a190726c99a7de690b0ad1
MD5 6a181f44dbb0b1268ac9d76af8926394
BLAKE2b-256 4ae427e6c4d567b5f9e60539e903f84a2232644a63f1865208e3fb1bdeaf2f2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_components_bootstrap-0.1.0.tar.gz:

Publisher: publish.yml on joeyjurjens/django-components-bootstrap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_components_bootstrap-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_components_bootstrap-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51ceeb3cd46c0a8b91eaec8520764563ccefc6708bfd2495d48a1a473daf7298
MD5 c544ca6f795c9f4dab4a4263ba84dc53
BLAKE2b-256 1d6ad9b8b93eff22a162eed5b509f667c9c69d5163fbcc1b34f97f3b71627716

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_components_bootstrap-0.1.0-py3-none-any.whl:

Publisher: publish.yml on joeyjurjens/django-components-bootstrap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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