Documentation Index
Fetch the complete documentation index at: https://mintlify.com/whitphx/stlite/llms.txt
Use this file to discover all available pages before exploring further.
@stlite/browser brings the full Streamlit runtime to any static web page. Powered by Pyodide and WebAssembly, it runs Python and Streamlit entirely inside the browser — no server, no backend, no deployment infrastructure required. The package exposes two complementary APIs: a declarative <streamlit-app> custom HTML element that you drop directly into your markup, and an imperative mount() JavaScript function that gives you full programmatic control over where and how the app renders.
Loading via CDN
Add the following<link> and <script> tags to your page’s <head>. The <link> tag loads the Streamlit stylesheet and the type="module" script registers the custom element and exports mount().
Always pin to a specific version in production. The API may change between
releases and the unversioned
latest URL is not guaranteed to be
backward-compatible.Minimal examples
Using the <streamlit-app> custom element
After loading the CDN script, place a <streamlit-app> tag anywhere in your <body>. Any Python code inside the tag is treated as the app’s entry point script.
Using the mount() function
Import mount from the CDN module and call it with your Python source code and a target DOM element. You must still load the CSS separately via <link>.
CDN URL variants
Next steps
Custom Element
Declaratively embed Streamlit apps with
<streamlit-app>, <app-file>, <app-requirements>, and <app-archive> tags.mount() API
Full API reference for the
mount() function, all options, and the returned controller object.Files & Archives
Mount inline strings, binary data, remote URLs, and zip archives onto the virtual file system.
Configuration
Customize Streamlit theme, toolbar mode, and other settings via
streamlitConfig or config.toml.