citry-bootstrap
Bootstrap 5 components for citry, with React-Bootstrap API parity.
Converted from django-components-bootstrap with djc-to-citry, which is itself AI-written. The components carry over that library's tests, 466 of them, but the conversion was mechanical.
Component documentation, with a rendered preview of every example.
Install
pip install citry-bootstrap
import citry_bootstrap
from citry import Citry
app = Citry()
citry_bootstrap.install(app)
Use
<c-bs-button variant="primary">Click me</c-bs-button>
<c-bs-alert variant="success" c-dismissible="True">Well done!</c-bs-alert>
<c-bs-card c-body="True">
<c-bs-card-title>Title</c-bs-card-title>
<c-bs-card-text>Some text.</c-bs-card-text>
</c-bs-card>
Bootstrap 5 lives in citry_bootstrap.components.bootstrap5, leaving room for a later major version beside it.
Naming
Components are published as <c-bs-button>. To publish them under something else:
citry_bootstrap.install(app, prefix="ui-") # <c-ui-button>
citry_bootstrap.install(app, prefix="") # <c-button>
That replaces the names rather than adding to them - nothing answers to bs- afterwards. A component's template names its siblings, so the prefix is rewritten in both places at once.
Replacing a component
Subclass it and hand it to install():
from citry_bootstrap.components.bootstrap5.card import CardBody
class MyCardBody(CardBody):
def template_data(self, kwargs, slots):
data = super().template_data(kwargs, slots)
data["div_attrs"] = {**data["div_attrs"], "data-testid": "body"}
return data
citry_bootstrap.install(app, override={CardBody: MyCardBody})
Yours is published under the same name, so every sibling renders it too - including Card, which builds its own body. The name follows prefix, so the two can be combined. Handing in something this library does not publish is an error rather than a silent no-op.
Develop
uv sync
pytest
ruff check . && ruff format --check .
The component pages are generated from the test suite, so an example cannot drift from the component it documents:
uv sync --group docs
uv run python docs/generate_docs.py
cd docs && uv run mkdocs serve
Metadata
Release files for citry-bootstrap 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| citry_bootstrap-0.2.0.tar.gz | 134.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| citry_bootstrap-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 183.2 kB
Release files / citry_bootstrap-0.2.0.tar.gz
| Download URL | citry_bootstrap-0.2.0.tar.gz |
|---|---|
| Size | 134.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b6c9bcf377c16b7fe6b4760e17077b8e0c889663fe5ad9e59fe2f1c970c244cd
|
|
BLAKE2b-256 checksum How to use checksums |
baca837b70fd2f242b44b6d77baad8c463a6ba44ef0679bb42d6330435b7f323
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / citry_bootstrap-0.2.0-py3-none-any.whl
| Download URL | citry_bootstrap-0.2.0-py3-none-any.whl |
|---|---|
| Size | 48.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
206694fb5a90eac7c6b09709bc99617bd4419ef12731ceafc20c7f1bc0154bb3
|
|
BLAKE2b-256 checksum How to use checksums |
23cf54014808b731f1651600b2fa01451b1b53e28392aa44fe77a73fae9b78eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency log