BI Components vs Streamlit¶
Streamlit turns a Python script into a web application: you call st.bar_chart(df) and a chart appears, with no HTML, no JavaScript and no API to write. It is the most used way to build a data app in Python, and it is open source (Apache 2.0, developed by Snowflake).
BI Components and Streamlit both make dashboards, from opposite ends:
- In Streamlit, a Python server builds the page. Your script runs on the server, from top to bottom, each time someone touches a widget. It loads the data, computes, and sends the browser what to draw. The application is the script.
- With BI Components, the browser builds the page. The dashboard is HTML. Each tag asks for its data, and the page filters itself when someone clicks. A server, in any language, only answers queries. The dashboard is a text, which a person or a model can write, and which another application can display.
They are not rivals as often as this page suggests: BI Components runs inside a Streamlit app, and that is one of its main uses.
| Choose Streamlit | Choose BI Components | |
|---|---|---|
| You are building | A data application in Python: dashboards, forms, what-if tools, chat | Dashboards inside a product or a site that already exists |
| Who writes it | A Python developer or a data scientist, with a coding agent | Anyone who writes HTML, or a model answering a user |
| When it is written | Before: code, reviewed and deployed | Before, or at the moment a user asks |
| Who reads it | Colleagues, on the address of the app | The users of your application, in your pages |
| Logic between the charts | Python: anything you can compute | Queries: measures, dimensions, filters |
| A click costs | A round trip to the server and a run of the script | A query, or nothing |
This page was written in December 2026, from the source and the documentation of Streamlit 1.67. Streamlit releases every two or three weeks: check its documentation for what changed since.
The same dashboard, twice¶
Revenue, and revenue by country, with a filter on the channel.
import streamlit as st
conn = st.connection("sql")
channel = st.selectbox("Channel", ["Web", "Store"])
df = conn.query(
"select country, sum(revenue) as revenue from orders"
" where channel = :channel group by country",
params={"channel": channel},
ttl="10m",
)
st.metric("Revenue", f"{df.revenue.sum():,.0f} €", border=True)
st.bar_chart(df, x="country", y="revenue")
The whole application: streamlit run app.py. To filter the page by a click on a bar, add on_select="rerun" to a chart and write the filtering in Python.
<source-api url="/api/queries"></source-api>
<ui-filter dimension="channel"></ui-filter>
<score-card measure="revenue"></score-card>
<bar-chart measure="revenue" by="country"></bar-chart>
<script src="https://unytics.io/bi-components/dist/bi-components.js" defer></script>
A piece of a page. The endpoint /api/queries is yours to write, once for every dashboard: see Your backend. A click on a bar filters the rest.
Streamlit has less to set up: one file, and it runs. BI Components has less to write per dashboard, once the endpoint exists.
What each one does¶
| Streamlit | BI Components | |
|---|---|---|
| A dashboard is | A Python script, run by a server | HTML, with custom elements |
| Charts | Simple ones (line, bar, area, scatter, map), and any chart of Altair, Vega-Lite, ECharts, Plotly, deck.gl or Matplotlib | Bar, line, pie, doughnut. Others with your own ECharts code |
| Key figures | st.metric: value, variation, sparkline |
Score card: value, comparison with another period computed by the query |
| Tables | A spreadsheet-like grid: search, column types (links, images, bars, sparklines), pinned columns, CSV, lazy loading. An editable version. | One sortable table with several dimensions and measures |
| Inputs | Some 25 widgets: select, slider, date, text, pills, file upload, forms | Period with presets, select, buttons, toggle |
| More than dashboards | Forms and write-back, file upload, chat, pages, dialogs, sign-in | No |
| Click on a chart to filter the page | With on_select and Python you write; each click runs the script |
Built in, on every chart and table |
| Data | Anything Python reaches: data frames, SQL connections, APIs | Files in the browser (CSV, Parquet, JSON), or whatever your backend queries |
| What the browser receives | The data frames given to the charts and tables | The rows each component asked for: aggregates |
| Named measures | None: you write the query or the pandas code | Yes, defined on your server |
| Sign-in and rights | st.login (OpenID Connect); what each user sees is your Python |
Those of your application |
| Show it in a product | An <iframe> on the whole application |
Tags in your page, or a sandboxed frame |
| Dashboards written by a model | An agent writes the Python, a developer deploys it | A model writes HTML, shown at once in a sandbox: Generative AI |
| Look | A theme (colors, fonts, radii). Custom CSS is discouraged. | Your HTML and CSS |
| To run it | A Python server with a WebSocket per open tab | A <script> tag, and one endpoint; or nothing, for a static page |
| Hosting | Yours, Snowflake, or Community Cloud (free, for public apps) | Wherever your pages are |
When to use which¶
Your team writes Python, and nobody wants a frontend. Use Streamlit. Nothing else gets a data scientist from a notebook to an application as fast, and the result has forms, tabs, sign-in and a theme.
The application computes. Use Streamlit. A forecast that reruns when a slider moves, a model scored on an uploaded file, an approval written back to a table: the logic is Python, between two widgets. BI Components only displays the answers to queries.
You need a chart that BI Components does not have. Use Streamlit: it draws whatever Altair, Plotly, ECharts or deck.gl can draw, from a data frame.
Your data is in Snowflake and the readers are colleagues. Use Streamlit in Snowflake: the application runs next to the data, with the access rules of the warehouse.
You are adding dashboards to a product that exists. Use BI Components. A Streamlit application is a server and a page of its own: it enters another site as an iframe on the whole application, with its own sign-in. BI Components tags go in your pages, next to your interface, and their queries go to your API with the session of your user. Streamlit's own documentation points to a custom stack when the application is customer-facing at large scale or when the interface is the product.
Your users ask questions, and a model answers with a dashboard. Use BI Components. In Streamlit, a dashboard is Python that runs on your server: letting a model write it for each question means running generated code with the rights of the application. An HTML dashboard runs in the browser of the person who asked, in a sandbox, and can only ask for what that person may see. If your chat is a Streamlit app, keep it: the sandbox goes inside.
Many people read the same dashboard. Use BI Components. A Streamlit server keeps a connection, a thread and a state for each open tab, and several replicas need sticky sessions. A page of tags is static, and its endpoint is stateless: it scales like any API, and caches like one.
The page must react at once. Use BI Components. A click on a bar highlights it immediately, and the other charts ask only for their own data. In Streamlit the click goes to the server, the script (or a fragment of it) runs, and the page is sent again.
You have a file and no server. Use BI Components: a static page queries a CSV or Parquet file in the browser.
Technical choices¶
Who builds the page¶
Streamlit's model is its best idea and its main limit. The script is the application: no callbacks to wire, no state to synchronize, no API between a front and a back. To make this work, the server keeps a session for each browser tab and runs the script again at every interaction. The browser sends the state of the widgets over a WebSocket; the server sends back the elements to draw, as a stream of differences.
What it costs is known, and Streamlit has an answer to each part:
- slow code runs again, so results are cached (
st.cache_data), by default for all users at once; - the whole script runs for one click, so a part can be isolated (
st.fragment); - several inputs make several runs, so they can be grouped (
st.form); - state lives in the memory of one process, so replicas need session affinity.
BI Components has no script. A page is a set of components that each know what they show. The state of the page (the selection, the period) lives in the browser, in window.dashboard. When it changes, each component sends its query again, and the server that answers knows nothing of the page: it gets a batch of queries, and returns rows.
The first model can express anything. The second can only express a dashboard, and that is why a dashboard can be handed over: stored as text, written by a model, shown by another application.
What travels¶
In Streamlit, data goes to the browser as data frames: the one you give to st.bar_chart or st.dataframe is serialized in Arrow and sent whole. Aggregating first is your code, in SQL or pandas. The documentation gives the limits: every row of a chart is sent to the browser, and a table loads lazily above 150,000 rows.
In BI Components a tag is a query: measure="revenue" by="country" asks for one row per country. The aggregation is done by the database, for every component, and nothing else can be asked. There is no table of raw data in the page to begin with. On the other hand, a page cannot compute anything: what is not a measure of your server or a SQL expression does not exist.
Filtering by a click¶
Streamlit's charts can return a selection: on_select="rerun" on an Altair, Vega-Lite, ECharts, Plotly or deck.gl chart, or on a table. The selection is a value in Python, and the script filters the other charts with it. It is flexible (a click can do anything) and it is code: for each chart, read the selection, filter the data, draw again. Each click is a run on the server. Charts of the same Altair specification can be linked in the browser; separate elements cannot.
In BI Components this is the default behavior and not a feature to build: a click on a value of any chart or table filters every other component, the clicked chart keeps showing all its values, and no attribute is needed. It does nothing else.
Code from someone else¶
Streamlit trusts the author of an application completely, and says so. The script runs on the server with the rights of the process. Its ways to add HTML or JavaScript run with the rights of the page:
st.htmlremoves scripts unless you allow them; allowed, they run in the page of the application;- a custom component of the first generation, and
st.iframe, run in a frame whose sandbox allowsallow-same-originwithallow-scripts. The source explains the choice: it "basically un-sandboxes" the frame, and makes nothing less secure, since the Python of a component is not sandboxed either; - a custom component of the second generation is mounted in the page itself. The source calls it "trusted code execution".
This is consistent: a Streamlit application is written by its team, and its components are libraries that team installs.
BI Components was designed for the other case, a dashboard written by a model or by a customer. It runs in a frame with allow-scripts only: no access to the page, to cookies, or to the network. Its queries are rebuilt from a strict schema by the page that holds it, then checked by your server, which applies the rights of the viewer. See the security model.
Agents¶
Both projects were shaped by language models, in two different places.
Streamlit calls itself "the agent-native data app framework". The agent it has in mind is a coding agent: it writes the Python of the application, with skills installed by streamlit skills, and a developer reviews and deploys. Streamlit's page on the subject says it plainly: a report made in a chat is a snapshot, an application is what a team relies on. Since 1.67 an application can also be read by an agent, over HTTP or MCP: its elements as data, its widgets as inputs.
BI Components is about the snapshot. A user asks a question, a model answers with a dashboard, and it is on screen at once, on live data, with the rights of that user. Nothing is deployed, so nothing can be reviewed: the format has to be safe by itself.
A team can want both. The dashboards that matter become applications; the questions of the day get an answer in the chat.
Together¶
A Streamlit application can show BI Components dashboards. The dashboard is one custom component whose JavaScript calls embedDashboard: Streamlit draws the chat, the sidebar and the widgets, and the component shows the HTML written by the model, in its sandbox. The queries of the dashboard come back to Python as the value of the component, and Python answers them with the rights of the signed-in user.
- A dashboard in a Streamlit app: native widgets and one sandboxed dashboard. Source.
- The playground, served by Streamlit: a whole chat interface as one component.
- How it works, and the one thing to know: the queries of a render travel together, because a component has one value and each value is a run of the script.
This is the setup to choose when the application is in Python and the dashboards are not written by its developers.
What Streamlit has that BI Components does not¶
Not counting what makes Streamlit an application framework (the script model, forms, file upload, chat, pages, sign-in, hosting), which BI Components leaves to your application. The list below is what a library of dashboard components could take from it.
Python
- A package to install. Streamlit is
pip install streamlit; BI Components has examples to copy. A Python package could hold the endpoint (validation of the queries, compilation to SQL, rights per viewer) and the Streamlit component, ready to import. - A cache for the answers, with a lifetime and a refresh in the background:
st.cache_datain one line. - Connections with their secrets (
st.connection), so that an endpoint is a few lines for Postgres, Snowflake or BigQuery.
Tables
- Search.
- Column types: a link, an image, a progress bar, a sparkline, a number format per column set in one place.
- Pinned columns, columns to hide and reorder.
- Statistics of a column.
- Rows loaded as you scroll, for a long table.
- Download as CSV, and a setting to forbid it.
- Selection of rows, columns or cells.
Key figures
- A sparkline in the card.
- A text beside the variation ("vs last month"), and a choice of what is good: up or down.
Charts
- Area, scatter, map.
- A chart from a JSON description, with the answer of a query as its data:
st.echarts_charttakes any ECharts option and binds a data frame to it, with no JavaScript. BI Components needs a script for a chart of your own. - Selections by a box or a lasso, not only by a click.
- A text alternative for each chart, for screen readers, and an accessibility audit.
Inputs
- A slider, a text field, a date with allowed and forbidden days, pills.
- A search in a long select.
- Inputs tied to the address of the page, to share a filtered view (
bind="query-params"). - Several inputs applied together by a button, to make one query.
Layout
- Tabs, an expander, a popover, a dialog, a grid, as elements with one line each. In BI Components these are HTML and CSS.
- A skeleton with the shape of what is loading.
Refresh
- A part of the page that asks again every N seconds.
Agents and tests
- Skills for coding agents, installed by a command, that match the installed version.
- The documentation as
llms.txt. - A dashboard an agent can read: its figures as data, over HTTP or MCP, with no more access than the viewer.
- Tests without a browser: load a dashboard, set a filter, check what a component shows (
AppTest).
Theme
- A theme in one file: fonts, radii, three palettes for charts (categories, sequences, diverging).
What BI Components has that Streamlit does not¶
- A dashboard is a text, not a program: it can be stored, written by a model, and shown by another application.
- It lives in your page. Any page, any framework, any backend language; no second application to host.
- A sandbox for dashboards written by someone else, and queries that can be checked.
- Filtering by a click, with nothing to write.
- Queries, not data frames. Each component asks for its aggregates; named measures are defined once on your server.
- Comparisons with another period, computed by the query:
compare="yoy". - No state on the server. One stateless endpoint, one request per render; nothing is kept per reader.
- No server at all, for a static page on a file.
- Your HTML and CSS around the charts.