"Faster than Light, Beautiful as Violet." Structure of Streamlit Γ Performance of React
Violit is a next-generation Python web framework that adopts a Fine-Grained State Architecture for instant reactivity, unlike Streamlit's Full Script Rerun structure.
Build applications that react at the speed of light with the most elegant syntax.
A dashboard built with Violit running in real-time.
Violit and Streamlit are similar in that they build UIs with Python code, but their internal mechanisms are fundamentally different.
| Feature | Streamlit (Traditional) | Violit (Reactive) |
|---|---|---|
| Execution Model | Full Script Rerun Reruns the entire script on every user interaction. |
Fine-Grained Updates Updates only the components connected to the modified State. |
| Performance | Response speed may degrade as data size increases. | Maintains consistent reactivity regardless of data scale. |
| Optimization | Requires optimization decorators like @cache, @fragment. |
Optimized by design without extra optimization code. |
| Deployment | Optimized for web browser execution. | Supports both Web Browser and Desktop Native App modes. |
| Design | Focuses on providing basic UI. | Provides ready-to-use designs with 20+ professional themes. |
-
Optimization by Design (Streamlit-Like Syntax, No Complexity): Streamlit's intuitive syntax is maintained, but complex optimization tools are removed at the architecture level.
- β No
@cache_data,@fragment,st.rerun: Thanks to the fine-grained structure, manual optimization is unnecessary. - β No
keyManagement: No need to manually specify unique keys for widget state management. - β No Complex Callbacks: No need to define complex callbacks/classes like Dash or Panel.
- β No
-
Ultra-Fast Speed: Even if you move the slider in 0.1s increments, the chart reacts in real-time without stuttering.
-
Hybrid Runtime:
- WebSocket Mode: Ultra-low latency bidirectional communication (Default)
- Lite Mode: HTTP-based, advantageous for handling large-scale concurrent connections
-
Desktop Mode: Can run as a perfect desktop application without Electron using the
--nativeoption.
You don't need to know CSS at all. Violit provides over 20 themes. (Soon, users will be able to easily add Custom Themes.)
Theme demo will be updated soon.
# Configuration at initialization
app = vl.App(theme='cyberpunk')
# Runtime change
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 |
Benchmark results showing how efficient Violit's fine-grained update method is compared to the existing full rerun method.
Detailed benchmark data will be updated soon.
| Framework | Architecture | Learning Curve | Performance | Desktop App | Real-time |
|---|---|---|---|---|---|
| Streamlit | Full Rerun | Very Easy | Slow | β | β³ |
| Dash | Callback | Medium | Fast | β | β³ |
| Panel | Param | Hard | Fast | β | β |
| Reflex | React (Compile) | Hard | Fast | β | β |
| NiceGUI | Vue | Easy | Fast | β | β |
| Violit | Signal | Very Easy | Fast | β | β |
Streamlit re-executes the entire script on button click, but Violit executes only that function.
# Streamlit
import streamlit as st
if "count" not in st.session_state:
st.session_state.count = 0
if st.button("Click"):
st.session_state.count += 1 # Rerun triggers here
st.write(st.session_state.count)# Violit
import violit as vl
app = vl.App()
count = app.state(0)
# Update only count on click (No Rerun)
app.button("Click", on_click=lambda: count.set(count.value + 1))
app.write(count) Dash requires complex Callbacks connecting Input/Output, but Violit only needs a single State.
# Dash
from dash import Dash, html, Input, Output, callback
app = Dash(__name__)
app.layout = html.Div([
html.Button("Click", id="btn"),
html.Div(id="out")
])
@callback(Output("out", "children"), Input("btn", "n_clicks"))
def update(n):
return f"Value: {n}" if n else "Value: 0"# Violit
count = app.state(0)
app.button("Click", on_click=lambda: count.set(count.value + 1))
# Automatic state dependency tracking -> No Callback needed
app.write(lambda: f"Value: {count.value}")NiceGUI is also great, but Violit offers a more concise syntax in the style of Streamlit.
# NiceGUI
from nicegui import ui
count = {'val': 0}
ui.button('Click', on_click=lambda: count.update(val=count['val'] + 1))
ui.label().bind_text_from(count, 'val', backward=lambda x: f'Value: {x}')# Violit
count = app.state(0)
app.button('Click', on_click=lambda: count.set(count.value + 1))
app.write(count) # No need for complex connections like .bind_textReflex requires State class definition and compilation, but Violit is a pure Python script.
# Reflex
import reflex as rx
class State(rx.State):
count: int = 0
def increment(self):
self.count += 1
def index():
return rx.vstack(
rx.button("Click", on_click=State.increment),
rx.text(State.count)
)# Violit
# No class definition needed, no compilation needed
count = app.state(0)
app.button("Click", on_click=lambda: count.set(count.value + 1))
app.write(count)Can be installed in Python 3.10+ environments.
pip install violit
# Or development version
pip install git+https://github.com/violit-dev/violit.gitCreate a hello.py file.
import violit as vl
app = vl.App(title="Hello Violit", theme='ocean')
app.title("π Hello, Violit!")
app.markdown("Experience the speed of **Zero Rerun**.")
count = app.state(0)
col1, col2 = app.columns(2)
with col1:
app.button("β Plus", on_click=lambda: count.set(count.value + 1))
with col2:
app.button("β Minus", on_click=lambda: count.set(count.value - 1))
app.metric("Current Count", count)
app.run()# Basic run (WebSocket Mode)
python hello.py
# Desktop App Mode (Recommended)
python hello.py --native
# Port configuration
python hello.py --port 8020Violit supports core Streamlit widgets, and some features have been redesigned for greater efficiency.
For a detailed compatibility list and information on unsupported widgets, please refer to the Streamlit API Support Matrix document.
- Backend: FastAPI (Async Python)
- Frontend: Web Components (Shoelace), Plotly.js, AG-Grid
- Protocol: WebSocket & HTTP/HTMX Hybrid
- State: Signal-based Reactivity
Violit is continuously evolving.
- β Core: Signal State Engine, Theme System
- β Widgets: Plotly, Dataframe, Input Widgets
- β Homepage: Official Homepage Open
- β Documentation: Official Technical Documentation and API Reference Update
- β³ Custom Components: User-defined Custom Component Support
- β³ Custom Theme: User-defined Custom Theme Support
- β³ async: Async processing support
- β³ More examples: Provide more real-world usable example code
- β³ Violit.Cloud: Cloud deployment service
- β³ Expansion: Integration of more third-party libraries
.
βββ violit/ # Framework source code
β βββ app.py # Main App class and 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 # Dependency listViolit is an open-source project. Let's build the future of faster and more beautiful Python UIs together.
- Fork this repository
- Create your feature branch
- Commit your changes
- Push to the branch
- 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.

