nicegui-bootstrap-components
Bootstrap 5 components for NiceGUI. The public API matches the dash-bootstrap-components 2.0.4 API for the component set listed below.
Install
The package requires Python 3.10 or later and NiceGUI >=3.17.1,<4; it has been tested against NiceGUI 3.17.1. It bundles Bootstrap 5.3.8. CI checks the oldest supported NiceGUI release and the newest available 3.x release.
pip install nicegui-bootstrap-components
Table.from_dataframe needs pandas, installed by the optional extra:
pip install "nicegui-bootstrap-components[examples]"
Quickstart
Save this as app.py and run python app.py. Open the local URL printed in the
terminal.
from nicegui import ui
from nicegui_bootstrap_components import bs
with bs.scope(), bs.container():
with bs.row():
with bs.col(width=12, md=6):
bs.input(placeholder="Name")
bs.button("Save", color="primary", on_click=lambda: ui.notify("Saved"))
ui.run()
Two API surfaces
nicegui_bootstrap_components.bs is the native surface: 67 PascalCase classes
and 67 snake_case aliases (134 exports). Use it for new NiceGUI code.
nicegui_bootstrap_components.dbc is the compatibility surface (66 exports)
with dash-bootstrap-components 2.0.4 prop names. Use it when porting Dash layouts.
from nicegui import ui
from nicegui_bootstrap_components import dbc
dbc.Container(
dbc.Row(dbc.Col(dbc.Button("Save", color="primary"), md=6)),
fluid=True,
)
Top-level exports: StyleMode, ThemeController, bs, dbc, icons, setup,
themes, __version__.
Style modes
setup() registers library CSS once, process-wide, and is idempotent for the same
arguments. A conflicting mode, or scoped mode with cdn=True, raises ValueError.
StyleMode.UNSCOPED("unscoped"): Bootstrap-first page.StyleMode.MIXED("mixed"): scoped Bootstrap islands inside an existing NiceGUI/Quasar page. Mark islands withbs.scope()(bs.Scopeis the class form).
from nicegui_bootstrap_components import StyleMode, setup, themes
setup(mode=StyleMode.MIXED, theme=themes.FLATLY, color_mode="auto")
Themes and dark mode
27 constants on themes: Bootstrap itself, the grid-only build, and 25 Bootswatch
themes. color_mode="auto" follows the host app. Pass icons.BOOTSTRAP or
icons.FONT_AWESOME to setup(icons=...).
BOOTSTRAP, CERULEAN, COSMO, CYBORG, DARKLY, FLATLY, GRID, JOURNAL,
LITERA, LUMEN, LUX, MATERIA, MINTY, MORPH, PULSE, QUARTZ, SANDSTONE,
SIMPLEX, SKETCHY, SLATE, SOLAR, SPACELAB, SUPERHERO, UNITED, VAPOR,
YETI, ZEPHYR.
Components
67 native names (each has a snake_case alias on bs):
Accordion, AccordionItem, Alert, Badge, Breadcrumb, Button, ButtonGroup, Card, CardBody, CardFooter, CardGroup, CardHeader, CardImg, CardImgOverlay, CardLink, Carousel, Checkbox, Checklist, Col, Collapse, Container, DropdownMenu, DropdownMenuItem, Fade, Form, FormFeedback, FormFloating, FormText, Input, InputGroup, InputGroupText, Label, ListGroup, ListGroupItem, Modal, ModalBody, ModalFooter, ModalHeader, ModalTitle, Nav, NavItem, NavLink, Navbar, NavbarBrand, NavbarSimple, NavbarToggler, Offcanvas, Pagination, Placeholder, Popover, PopoverBody, PopoverHeader, Progress, RadioButton, RadioItems, Row, Scope, Select, Spinner, Stack, Switch, Tab, Table, Tabs, Textarea, Toast, Tooltip.
Layout
from nicegui_bootstrap_components import bs
with bs.scope(), bs.container():
with bs.row():
with bs.col(width=12, md=4):
bs.label("Full width on phones, one third from md")
with bs.col(width=12, md=4):
bs.label("Middle")
with bs.col(width=12, md=4):
bs.label("Right")
Forms
from nicegui_bootstrap_components import bs
with bs.scope():
bs.input(placeholder="Your name", on_change=lambda: None)
bs.select(options={"my": "Malaysia", "sg": "Singapore"}, value="my")
bs.checkbox(label="Remember me")
bs.switch(label="Enable alerts")
Cards, alerts, and badges
from nicegui_bootstrap_components import bs
with bs.scope(), bs.card():
bs.card_header("Header")
with bs.card_body():
bs.alert("Something happened.", color="info", dismissable=True)
bs.badge("New", color="success")
Modal
from nicegui_bootstrap_components import bs
with bs.scope():
with bs.modal() as modal:
bs.modal_header("Title")
bs.modal_body("Content")
bs.modal_footer(bs.button("Close", on_click=modal.close))
Table
import pandas as pd
from nicegui_bootstrap_components import bs
df = pd.DataFrame({"city": ["Kuala Lumpur"], "country": ["Malaysia"]})
with bs.scope():
bs.Table.from_dataframe(df, striped=True, bordered=False, hover=True)
Examples
The gallery mirrors dash-bootstrap-components: Layer 1 component examples, Layer 2 composite apps (Iris, Graphs in Tabs, Simple Sidebar), and Layer 3 templates.
Documentation
https://raffieeey.github.io/nicegui-bootstrap-components/
Development
git clone https://github.com/raffieeey/nicegui-bootstrap-components.git
cd nicegui-bootstrap-components
pip install -e ".[dev]"
pytest
Install Chromium for browser tests with python -m playwright install chromium.
CI runs checks, documentation and browser jobs. The browser suite uses real
Chromium alongside a visual matrix. Python documentation blocks and examples
are executed by tests, so a snippet that cannot run fails CI.
License
MIT. See LICENSE.
Status
0.1.3, maintenance release. Matches the dash-bootstrap-components 2.0.4 API for the component set listed above, with documented adaptations. Built-in persistence is unsupported: non-off persistence modes raise an error. Use application-managed storage instead.
Metadata
Release files for nicegui-bootstrap-components 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nicegui_bootstrap_components-0.1.3.tar.gz | 7.4 MB | With provenance | Details for nicegui_bootstrap_components-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nicegui_bootstrap_components-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for nicegui_bootstrap_components-0.1.3-py3-none-any.whl |
Total release size: 10.4 MB
Release files / nicegui_bootstrap_components-0.1.3.tar.gz
| Download URL | nicegui_bootstrap_components-0.1.3.tar.gz |
|---|---|
| Size | 7.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7eca0bb05eed6435bbd579a53c166b9be73b26de2452ec71987a2d864d3d945
|
|
BLAKE2b-256 checksum How to use checksums |
56cedac05580dfef4ac95af157680744acd71753e4c5e471739ea003caabe901
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 5, 2026.
Transparency logRelease files / nicegui_bootstrap_components-0.1.3-py3-none-any.whl
| Download URL | nicegui_bootstrap_components-0.1.3-py3-none-any.whl |
|---|---|
| Size | 3.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
823a5d5e09314dd78064bc451765ae9edbd7422ddb265b2b2f51f6d8f571bbb2
|
|
BLAKE2b-256 checksum How to use checksums |
4c28e9eb811363bee781ef0a35541462aa2f76b3346616fe1930b871fdf955c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 5, 2026.
Transparency logSecurity for nicegui-bootstrap-components 0.1.3
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for nicegui_bootstrap_components-0.1.3.tar.gz
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 Nov 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.