r/FastAPI • • Jan 24 '26

pip package I built "Violit": A High-Performance UI Framework powered by FastAPI & Signals (O(1) reactivity without reruns)

Hi everyone,

I’m a huge fan of the FastAPI ecosystem. While I love FastAPI for its performance, I’ve always struggled to find a Python UI framework that matches its "async-first" speed without the developer friction.

Streamlit is great for prototyping, but the "full script rerun" on every interaction is a performance bottleneck. So, I built Violit. It’s an open-source framework that uses FastAPI as the core engine to deliver a Streamlit-like DX but with O(1) signal-based reactivity.

Demo

Why FastAPI?

I chose FastAPI because I wanted Violit to be production-ready and async-native from day one.

  • State over WebSockets: Violit maintains a persistent connection via FastAPI’s WebSocket implementation. When a state (Signal) changes, only the specific component updates—no page refreshes or full script reruns.
  • Async-First: Since it’s built on FastAPI, it handles asynchronous tasks (like AI inference or DB queries) without blocking the UI. (This feature will be updated soon.)
  • High Throughput: By leveraging Uvicorn/Starlette under the hood, it scales far better than traditional "rerun-based" frameworks.

Key Features

  • Zero Rerun Architecture: Pure O(1) state updates.
  • 90% Streamlit Compatibility: If you know Streamlit, you already know Violit.
  • Shoelace Web Components: Modern, accessible UI elements.
  • 30+ Built-in Themes: Switch from "Cyberpunk" to "Dracula" with one line: app.theme('dracula').
  • Native Mode: Package your FastAPI-based web app into a desktop app with --native.

Simple Example

import violit as vl
​
app = vl.App()
count = app.state(0) # Reactive Signal
​
# No full script rerun! 
# FastAPI handles the WebSocket message and updates only the label.
app.button("Increment", on_click=lambda: count.set(count.value + 1))
app.write("Current Count:", count)
​
app.run()

Feedback Wanted!

As a fellow FastAPI user, I’d love to hear your thoughts on the architecture. Is there anything you'd like to see in a "FastAPI-based frontend" framework?

I’m currently in early Alpha (v0.0.2) and looking for contributors and feedback to make Python web development even faster!

53 Upvotes

18 comments sorted by

View all comments

5

u/Virtual-Reporter486 Jan 24 '26

Can this replace frontend libs and frameworks like React and Vue?

4

u/Puzzleheaded_Clerk68 Jan 24 '26 edited Jan 25 '26

Great question!

Short answer: Yes for data apps/internal tools and MVP Prototyping, No for pixel-perfect consumer apps.

If you are building dashboards, admin panels, or prototypes, Violit can definitely replace them (and save you from 'JS fatigue'). But if you need 100% control over the DOM for a highly custom consumer app, React/Vue is still the way to go.

Think of it as 'React for Python devs who don't want to touch JavaScript.'

1

u/Virtual-Reporter486 Jan 25 '26

That's simply awesome! I always wanted something like this. What prevents Violit from evolving to a complete alternative to JS frameworks? I know you said it's not its goal, but what if it was?

2

u/Puzzleheaded_Clerk68 Feb 01 '26

Wow, huge compliment..!! 🙏

​Honestly, I started this just as a performant alternative to Streamlit. But as I built it, I realized: most web apps don't actually need complex, sub-millisecond JS interactions.

​So yes.. I’m starting to see its potential as a faster alternative to Django, Rails or even React for general web building.

​That’s exactly why I’m currently adding Semantic Props and Master CSS support to allow for fully custom, professional UIs beyond just simple 'data dashboards'. And I'm also currently working on the official website and documentation.. :)

3

u/DynamicBR Jan 24 '26

That's what I wanted to ask: if Violit is good, would it be a good way to develop a front-end using FastAPI?

4

u/Puzzleheaded_Clerk68 Jan 25 '26

To clarify, Violit is designed as a standalone full-stack framework for building entire apps in pure Python, rather than just a frontend layer for existing backends.

The reason I shared it in this channel is because Violit's core engine is built on FastAPI. I wanted to highlight that it relies on FastAPI's robust and high-performance architecture under the hood.

Thanks for asking..!!

2

u/DynamicBR Jan 25 '26

Ah, I understand, thank you very much!