"Faster than Light, Beautiful as Violet." Streamlit's Intuition Γ React's Performance
Violit is a next-generation Python web framework that perfectly solves Streamlit's critical Full Script Rerun issue with O(1) State Architecture.
Build applications that react at the speed of light with the most elegant syntax.
Violit isn't just "faster Streamlit". The architecture itself is different.
| Feature | Streamlit π’ | Violit π |
|---|---|---|
| Architecture | Full Rerun (O(N)) Re-executes the entire code on a single button press |
Zero Rerun (O(1)) β‘ Updates only the changed components exactly |
| UX/UI | Slow response, screen flickering | React-grade Reactivity, smooth with no flicker |
| Optimization | Complex optimizations like @cache, @fragment required |
No optimization code needed (Optimized by design) |
| Scalability | Limited concurrent users (High memory usage) | Lite Mode supports massive traffic π |
| Deployment | Web browser only | Web + Desktop App Mode π» |
| Design | Basic default design | 30+ Premium Themes built-in π¨ |
- Ultra-Fast Speed: Charts react in real-time without stutter, even when dragging sliders in 0.1s increments.
- Streamlit-Like API: Existing Streamlit users can adapt in 10 minutes. Code is 90% compatible.
- Hybrid Runtime:
- WebSocket Mode: Ultra-low latency bidirectional communication, real-time broadcasting (Default) β‘
- Lite Mode: HTTP-based, handles thousands of concurrent users (For large-scale dashboards)
- Run as Desktop Mode: Create a perfect desktop app without Electron using a single
--nativeflag.
| Framework | Architecture | Learning Curve | Performance | Desktop App | Real-time |
|---|---|---|---|---|---|
| Streamlit | Full Rerun (O(N)) | βββββ Very Easy | π’ Slow | β | β (Limited) |
| Dash (Plotly) | Callback Based | βββ Average | β‘ Fast | β | β (Complex) |
| Panel | Param Based | ββ Hard | β‘ Fast | β | β |
| NiceGUI | Vue Based | ββββ Easy | β‘ Fast | β | β |
| Reflex | React Style | ββ Hard | β‘ Fast | β | β |
| Violit π | Zero Rerun (O(1)) | βββββ Very Easy | β‘β‘ Fastest | β | β Built-in |
# Easy like Streamlit, but instant reaction without re-rendering
app.button("Click", on_click=lambda: count.set(count.value + 1))
app.write("Count:", count) # Updates only this part when State changes!- Keeps Streamlit's intuitive API, removes Full Rerun pain completely.
- No need for complex optimizations like caching, fragments, or reruns.
# Dash needs complex callback chains, but
# Violit automatically updates dependent components just by changing State
count = app.state(0)
app.write(lambda: f"Value: {count.value}") # Auto-tracking- Removes Dash's
@callbackboilerplate hell. - More intuitive State-based reactivity.
# Simple, without Panel's Param class
name = app.state("World")
app.write(lambda: f"Hello, {name.value}!")- No need for Panel's complex Param system.
- Easy like Streamlit, powerful like Panel.
- Supports real-time WebSocket like NiceGUI.
- But Violit adds 30+ Premium Themes and Desktop Mode.
- No Vue.js knowledge needed, Python is enough.
# Reflex needs complex config and compilation, Violit is:
import violit as vl
app = vl.App()
app.title("Hello!")
app.run() # Done!- No Node.js dependency like Reflex.
- No separate build step, complete with a single Python file.
- Zero Configuration:
pip install violitβ Start immediately. - Zero Learning Curve: If you know Streamlit, you're done in 5 minutes.
- Zero Performance Issues: O(1) architecture scales to any size.
- Desktop Mode: Run desktop mode with a single
--nativeline. - 30+ Premium Themes: Expert-level UI without a designer.
- Real-time Broadcasting: Multi-user synchronization built-in.
The code re-runs from top to bottom on every interaction. Data is re-loaded every time.
import streamlit as st
# β οΈ This heavy function runs repeatedly on every button click
df = load_huge_dataset()
if 'count' not in st.session_state:
st.session_state.count = 0
# β οΈ Screen flickers due to full page reload
if st.button('Increase'):
st.session_state.count += 1
st.write(f"Count: {st.session_state.count}")The script runs only once. UI automatically reacts when State changes.
import violit as vl
app = vl.App()
# β
Runs only once! 0% resource waste
df = load_huge_dataset()
# Declare State (Signal based)
count = app.state(0)
# Changing value on click -> UI reflects instantly (No Rerun)
app.button("Increase", on_click=lambda: count.set(count.value + 1))
# β¨ Auto-Reactive by passing State object directly!
app.write("Count:", count)
app.run()Violit eliminates the unnecessary complexity that plagued developers.
- β
@st.cache_data: Why cache when code only runs once? - β
@st.fragment: All Violit widgets are already independent. - β
st.rerun(): No need to force re-execution. Just change the state. - β
key="widget_1": No need to manage keys to preserve widget state. - β Complex Callback Chains: No need to link Input/Output like in Dash. State solves everything.
- β Defining Param Classes: No need to write complex parameter classes like in Panel.
# 1. State-based Reactivity (Solid.js Signals style)
counter = app.state(0)
app.write(counter) # Auto-update when counter changes!
# 2. Dynamic Content with Lambdas
app.write(lambda: f"Current Time: {time.time()}") # Auto-dependency tracking
# 3. Clear Actions with Callbacks
app.button("Click", on_click=lambda: counter.set(counter.value + 1))You don't need to know CSS at all. Violit provides over 30 designer-tuned themes.
# Change theme with one line
app = vl.App(theme='cyberpunk', title='My App')
# Change at runtime
app.set_theme('ocean')| Theme Family | Examples |
|---|---|
| Dark π | dark, dracula, monokai, ocean, forest, sunset |
| Light βοΈ | light, pastel, retro, nord, soft_neu |
| Tech π€ | cyberpunk, terminal, cyber_hud, blueprint |
| Professional πΌ | editorial, bootstrap, ant, material, lg_innotek |
Comparison with others:
- Streamlit: Only basic themes, complex customization.
- Dash: Must write CSS manually.
- Panel: Limited theme options.
- Violit: 30+ ready-to-use expert themes π
Install violit from PyPI. (Python 3.10+ required)
pip install violit
# Or development version
pip install git+https://github.com/violit-dev/violit.gitCreate a hello.py file.
import violit as vl
# Create Violit app instance
app = vl.App(title="Hello Violit", theme='ocean')
app.title("π Hello, Violit!")
app.markdown("Experience the speed of **Zero Rerun**.")
# Define State
count = app.state(0)
col1, col2 = app.columns(2)
with col1:
# Cleanly change value on click
app.button("β Plus", on_click=lambda: [count.set(count.value + 1), app.balloons()])
with col2:
app.button("β Minus", on_click=lambda: count.set(count.value - 1))
# Real-time reactive metric
app.metric("Current Count", count)
app.run()Run in web browser mode or desktop app mode.
# Run in Web Browser (Default: WebSocket Mode)
python hello.py
# Run in Lite Mode (For handling massive traffic)
python hello.py --mode lite
# π₯οΈ Desktop App Mode (Highly Recommended!)
python hello.py --native --splashViolit supports most major Streamlit APIs, improving some structures for better performance.
| Streamlit | Violit Support | Status | Note |
|---|---|---|---|
st.write |
app.write |
β | 100% Compatible (Signal/State auto-detect) |
st.markdown |
app.markdown |
β | Markdown syntax supported |
st.title, st.header |
app.title, app.header |
β | Gradient effects auto-applied |
st.subheader, st.caption |
app.subheader, app.caption |
β | |
st.code |
app.code |
β | Syntax Highlighting supported |
st.text |
app.text |
β | |
st.latex |
app.latex |
β | Recommend using Markdown math $..$ |
st.divider |
app.divider |
β | |
st.image |
app.image |
β | URL, Local File, NumPy, PIL supported |
st.audio, st.video |
app.audio, app.video |
β |
| Streamlit | Violit Support | Status | Note |
|---|---|---|---|
st.dataframe |
app.dataframe |
β | Ag-Grid Native (High Performance) |
st.table |
app.table |
β | |
st.metric |
app.metric |
β | Supports delta and auto-color |
st.json |
app.json |
β | |
st.data_editor |
app.data_editor |
β | Simplified version provided |
st.plotly_chart |
app.plotly_chart |
β | Full Plotly compatibility |
st.pyplot |
app.pyplot |
β | Matplotlib supported |
st.line/bar/area_chart |
app.line_chart etc. |
β | |
st.scatter_chart |
app.scatter_chart |
β | |
st.map |
app.map |
β | Recommend Mapbox via plotly_chart |
| Streamlit | Violit Support | Status | Note |
|---|---|---|---|
st.button |
app.button |
β | key not needed, on_click recommended |
st.download_button |
app.download_button |
β | |
st.link_button |
app.link_button |
β | |
st.text_input |
app.text_input |
β | |
st.number_input |
app.number_input |
β | |
st.text_area |
app.text_area |
β | |
st.checkbox, st.toggle |
app.checkbox, app.toggle |
β | |
st.radio |
app.radio |
β | |
st.selectbox |
app.selectbox |
β | |
st.multiselect |
app.multiselect |
β | |
st.slider |
app.slider |
β | |
st.date/time_input |
app.date_input etc. |
β | |
st.file_uploader |
app.file_uploader |
β | |
st.color_picker |
app.color_picker |
β | |
st.camera_input |
app.camera_input |
β | Not supported |
| Streamlit | Violit Support | Status | Note |
|---|---|---|---|
st.columns |
app.columns |
β | List ratios supported (e.g., [1, 2, 1]) |
st.container |
app.container |
β | |
st.expander |
app.expander |
β | |
st.tabs |
app.tabs |
β | |
st.empty |
app.empty |
β | For dynamic updates |
st.sidebar |
app.sidebar |
β | Use with app.sidebar: syntax |
st.dialog |
app.dialog |
β | Modal Decorator supported |
st.popover |
app.popover |
β | Recommend using app.dialog |
| Streamlit | Violit Support | Status | Note |
|---|---|---|---|
st.chat_message |
app.chat_message |
β | Avatar supported |
st.chat_input |
app.chat_input |
β | |
st.status |
app.status |
β | |
st.spinner |
app.spinner |
β | |
st.progress |
app.progress |
β | |
st.toast |
app.toast |
β | |
st.balloons, st.snow |
app.balloons etc. |
β | |
st.success/error/warning |
app.success etc. |
β |
| Streamlit | Violit Approach | Note |
|---|---|---|
st.rerun |
Unnecessary | Instant partial update on State change (Zero Rerun) |
st.stop |
Unnecessary | Handle with Python flow control (return, etc.) |
st.form |
app.form |
β Supported (For batch input) |
Violit is absorbing the features of popular Streamlit third-party libraries natively.
| Library | Violit Status | Description |
|---|---|---|
| streamlit-aggrid | β Native | app.dataframe natively uses high-performance AG-Grid. No separate install needed. |
| Plotly | β Native | Perfectly supported via app.plotly_chart. |
| streamlit-lottie | β Planned | Currently unsupported (Will add app.lottie). |
| streamlit-option-menu | β Native | Built-in Sidebar perfectly replaces Multi-page Navigation. |
| streamlit-extras | Some design elements like Metric Cards can be replaced with Violit's theme system. | |
| streamlit-webrtc | Planned support via WebSocket-based real-time communication. |
Unique features found only in Violit, not in Streamlit:
- Broadcasting API: Real-time multi-user synchronization (
app.broadcaster) - Card List: Auto-managed dynamic list UI (
app.card_list) - Desktop Mode: Instant desktop app via
--nativeflag - Hot Reload: Auto-refresh on code change (Dev mode)
- Animation Modes: Smooth page transitions (
animation_mode='soft')
Violit combines modern web technologies with the power of Python.
- Backend: FastAPI (Async Python) - High-performance async processing
- Frontend: Web Components (Shoelace) - Modern UI components
- Protocol: WebSocket (default) & HTTP/HTMX (lite mode) - Hybrid choice
- State: Signal-based Reactivity - Solid.js style fine-grained reactivity
- Charts: Plotly.js - Interactive charts
- Data Grid: AG-Grid - Enterprise-grade data tables
- Desktop: pywebview - Lightweight desktop apps without Electron
Unlike other frameworks, Violit:
- β No Node.js required (Unlike Reflex)
- β No React/Vue build required (Pure Web Components)
- β No complex compilation steps
- β Just Python and pip!
.
βββ violit/ # Framework source code
β βββ app.py # Main App class & entry point
β βββ broadcast.py # Real-time WebSocket broadcasting
β βββ state.py # Reactive State engine
β βββ theme.py # Theme management
β βββ assets/ # Built-in static files
β βββ widgets/ # Widget implementations
β βββ input_widgets.py
β βββ data_widgets.py
β βββ layout_widgets.py
β βββ ...
βββ requirements.txt # DependenciesViolit is an open-source project. Let's build the future of faster, more beautiful Python UI together.
- Fork this repository
- Create your feature branch (
git checkout -b feature/amazing) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing) - Open a Pull Request
MIT License
Violitβ’ is a trademark of The Violit Team.
Made with π by the Violit Team
Faster than Light, Beautiful as Violet.
