Skip to main content

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.

CI Python >=3.10 License: MIT

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 with bs.scope() (bs.Scope is 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.2, security and correctness 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.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nicegui-bootstrap-components 0.1.2
File Size Uploaded Provenance Actions
nicegui_bootstrap_components-0.1.2.tar.gz 7.4 MB With provenance Details for nicegui_bootstrap_components-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nicegui-bootstrap-components 0.1.2
File Interpreter ABI Platform Actions
nicegui_bootstrap_components-0.1.2-py3-none-any.whl Python 3 none any Details for nicegui_bootstrap_components-0.1.2-py3-none-any.whl

Total release size: 10.4 MB

Release files / nicegui_bootstrap_components-0.1.2.tar.gz

Download URL nicegui_bootstrap_components-0.1.2.tar.gz
Size 7.4 MB
Tags Source
SHA-256 checksum
How to use checksums
d6a6b82151e7fd1c92aab3f4b442056c3662894222190badb980285d6b681e4e
BLAKE2b-256 checksum
How to use checksums
ee82f01a68584b90cb8b8f23cd1f187eaae8da134b429008096eae7aba276726
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 log

Release files / nicegui_bootstrap_components-0.1.2-py3-none-any.whl

Download URL nicegui_bootstrap_components-0.1.2-py3-none-any.whl
Size 3.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b21dc18af86eba78457030950effae347f414cc84a3fcf7563fb51c6c98527eb
BLAKE2b-256 checksum
How to use checksums
333a15c4a0ba20d060808c7d907bc0c23ebc4ad9dcf676b715759927548c1ff0
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 log

Security for nicegui-bootstrap-components 0.1.2

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.

Select from 2 files

Attestation for nicegui_bootstrap_components-0.1.2.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 log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page