+5
日增长
+43
周增长
+79
月增长
29,028
stars
1,842
forks
179
watchers
4,558
prs
2,601
issues
455
releases
README
✨ Performant, customizable web apps in pure Python. Deploy in seconds. ✨
!versions
---
[!NOTE]
Build faster with Reflex:
- AI Builder - Generate full-stack Reflex apps in seconds.
- Agent Toolkit - Connect MCP and Skills to your coding assistant.
- App Management - Deploy and manage your Reflex apps.
---
Introduction
Reflex is a library to build full-stack web apps in pure Python.
Key features:
- Pure Python - Write your app's frontend and backend all in Python, no need to learn Javascript.
- Full Flexibility - Reflex is easy to get started with, but can also scale to complex apps.
See our architecture page to learn how Reflex works under the hood.
⚙️ Installation
Important: We strongly recommend using a virtual environment to ensure the reflex command is available in your PATH.
🥳 Create your first app
Create a project, add Reflex, and start the development server with uv:
shell
mkdir my_app_name
cd my_app_name
uv init
uv add reflex
uv run reflex init
uv run reflex run
You should see your app running at http://localhost:3000.
Now you can modify the source code in my_app_name/my_app_name.py. Reflex has fast refreshes so you can see your changes instantly when you save your code.
🫧 Example App
Build an image generation app in Python with Reflex: define the UI, manage state in a class, and call an image model from an event handler.
python
import reflex as rx
import openai
client = openai.AsyncOpenAI()
class State(rx.State):
prompt: str = ""
image_url: str = ""
processing: bool = False
@rx.event
def set_prompt(self, value: str):
self.prompt = value
@rx.event
async def generate(self):
self.processing = True
yield
response = await client.images.generate(
model="gpt-image-1.5",
prompt=self.prompt,
)
self.image_url = f"data:image/png;base64,{response.data[0].b64_json}"
self.processing = False
def index():
return rx.vstack(
rx.heading("Image Generator"),
rx.input(placeholder="Enter a prompt...", on_change=State.set_prompt),
rx.button("Generate", on_click=State.generate, loading=State.processing),
rx.image(src=State.image_url),
)
app = rx.App()
app.add_page(index, title="Reflex:Image Generation")
All Thanks To Our Contributors:Top issues
#2727Reflex Roadmap37 comments · 2024-02-27#3711Support for custom event triggers in ComponentStates13 comments · 2024-07-26#4580Dynamic Page Meta11 comments · 2025-01-02#4221form.submit() fails if using dialog.close()10 comments · 2024-10-22#2339Internationalization (I18N) and localization (L10N) (Feature Request) 10 comments · 2023-12-29#46Embedding Reflex in other apps10 comments · 2022-12-09#3718Custom components with ComponentState not compatible with rx.foreach9 comments · 2024-07-25#2426[REF-2738] Data table does not overflow7 comments · 2024-01-20
Discussions
#7730Unexpected Server Errors1 comments · 2026-11-04#7577Built with Reflex badge remains visible on Reflex Cloud despite show_built_with_reflex=False2 comments · 2026-10-15#7387Custom domain stuck on Cloudflare ownership verification and Error 1000 – retevox.ro1 comments · 2026-10-02#7367Research inquiry: Reflex’s PyPI approval workflow2 comments · 2026-09-30#6870stuck deployments0 comments · 2026-08-11#6832Reflex won Repository Radar's Understory of the Month 🎛️1 comments · 2026-08-03#6623Read-only PR review bottleneck brief for reflex-dev/reflex0 comments · 2026-06-06#6615reflex --compile needs to run twice1 comments · 2026-06-05
Latest release
v0.11.0 v0.11.0 2026-11-12Breaking Changes - @rx.event now returns an EventHandler instead of the decorated function. A decorator stacked above @rx.event is deprecated: the method still runs and registers under its own name, with a deprecation warning, until 1.0; apply other decorators below @rx.event. @rx.event on a method of a class that is not a state keeps working when called through an instance, and on a staticmethod or classmethod leaves it unchanged; both warn and should be removed, and calling such a method through the class (Helper.compute(obj, 3)) is not supported. A module-level function decorated with @rx.