Streamlit for D. Write data apps as a plain D function that reruns from top to bottom on every
interaction, the way you write them in Python with Streamlit.
dub build produces one self-contained binary: the web UI, charts, maps, math rendering and
fonts are compiled in, so it runs offline and deploys by copying a file.
import streamlitd;
void app(St st)
{
st.title("Hello 👋");
auto name = st.textInput("Your name", "World");
auto n = st.slider("Times", 1, 10, 3);
if (st.button("Greet", type: "primary"))
st.success("Hello " ~ name ~ "!");
}
mixin StreamlitMain!app;dub run # → http://localhost:8501📚 Documentation: docs/ has the getting started guide, the tutorial and the Python → D cheat sheet.
Sales dashboard from the tutorial: cached CSV, filters, metrics, charts |
Every input widget: text, numbers, sliders, selects, dates, colors |
DataFrames: sortable, searchable tables with CSV export |
Charts: line, bar, area, scatter and any Vega-Lite spec |
Data editor: edit, add and delete rows |
Plotly figures with selection events |
Chat UI and multipage navigation (dark mode) |
Dialogs, fragments and partial reruns |
LaTeX (KaTeX) and syntax-highlighted code |
Maps (Leaflet, configurable tiles) |
Layout: columns, tabs, expanders, containers, popovers |
Login: password users and OIDC single sign-on |
Themed controls: searchable selects, calendar, time list and color picker (no native browser pop-ups) |
Design × scheme: win95 × paper |
8 design styles × 8 color schemes × light/dark (theming): streamlit, terminal, retro, win95, XP, brutalist, material and glass, each usable with any color scheme:
terminal × solarized, dark |
win95 × paper |
- Streamlit's programming model: reruns, widget state,
st.session, callbacks, forms,st.rerun/st.stop,cacheData/cacheResource, multipagest.navigation, query params. - About 70 elements and widgets:
- text, markdown (with
:color[...]and$math$), alerts, metrics, JSON, progress, spinner, toast - all input widgets, file upload and download, chat input and messages
- pills, segmented control, feedback
- text, markdown (with
- Layout: sidebar, columns, tabs, expanders, containers, popovers,
st.empty, dialogs, status containers, fragments withrunEveryauto-refresh. - Data: a
DataFrametype (structs, CSV, JSON; filter, sort, groupBy), interactive tables, a data editor, Vega-Lite charts, Plotly, maps, images, audio, video. - Theming: 8 design styles (terminal, retro, win95, XP, brutalist, material, glass, streamlit) ×
8 color schemes × light/dark, custom colors and fonts (Streamlit-compatible
[theme]keys), and a viewer appearance menu. - Production:
- worker threads, so CPU-heavy sessions don't block other users
config.tomlandsecrets.toml(existing.streamlit/files work)- base URL path for reverse proxies, origin checks, session limits
- Docker image, health endpoint
- Auth: sign-up with automatic password hashing (the first account is admin), invites or
approval, roles (
st.user.hasRole,st.requireRole), a ready-made admin panel (st.userAdmin()), account page, login throttling, CLI user commands; plus users insecrets.tomland OIDC (Google, Entra ID, Keycloak, …): Authentication. - App shell and business UI beyond Streamlit: top navigation with sections, breadcrumbs, a header bar, user menu, footer and banners; menu buttons, pagination, cards, stepper, timeline, tags, tree select, date ranges and more: Layout, More elements.
- Custom components compatible with Streamlit's component protocol.
- Extensible: add your own color schemes, design styles and native widgets, in D or in
config.toml: Extending. - JSON API endpoints next to the UI (FastAPI-style typed REST interfaces via vibe.d), on the same
port and login, with an optional generated OpenAPI document and Swagger UI at
/docs: API endpoints. - Testing: headless
AppTestfor unit tests; Playwright end-to-end tests. - Branding: streamlitd's own favicon by default; set yours per app (
[server] favicon,--favicon) or per page (st.setPageConfig(icon:)with an emoji, URL or image file; multipage apps show the page icon).
| Getting started | install, first app, project layout |
| Tutorial | build a dashboard step by step |
| Core concepts | reruns, state, callbacks, forms, fragments, caching, threads |
| Layout & navigation · Data & charts · Theming | guides |
| Configuration · Deployment (Docker, nginx, systemd) · Authentication | running in production |
| Custom components · Extending · JSON API endpoints · Testing | extending and testing |
| Porting from Python · Cheat sheet · API reference | reference |
| Troubleshooting · Architecture | FAQ and internals |
- dub and a D compiler. Tested with LDC 1.36 and DMD 2.114.
- OpenSSL 3 and zlib at runtime, as with every vibe.d app.
source/streamlitd/ the library (server, session, St API, DataFrame, charts, auth, ...)
assets/ frontend: index.html, app.js, style.css, vendor/ (bundled JS libraries)
examples/ runnable apps: hello, widgets, data, multipage, themes, prod, fragments, extras, auth, tutorial, api, custom
docs/ documentation and screenshots
tests/unit/ headless AppTest suites (dub test)
tests/e2e/ Playwright end-to-end tests and the screenshot script
tools/ asset list, API docs and doc-snippet generators/checkers
./run-tests.sh # D unit tests + Playwright e2e tests + compile every doc snippetMIT. Bundled third-party libraries are listed in assets/vendor/licenses.















