Agent Skills
› reflex-dev/xy
› reflex-docs
reflex-docs
GitHubReflex框架文档助手,用于指导全栈Python Web应用开发。涵盖组件、状态管理、事件处理、样式、数据库及部署等核心概念与API参考,适用于构建纯Python Web应用时的知识查询与问题排查。
触发场景
用户询问Reflex框架相关概念(如State, Vars, EventHandlers)
用户正在编写导入reflex的.py文件或构建Reflex应用
安装
npx skills add reflex-dev/xy --skill reflex-docs -g -y
SKILL.md
Frontmatter
{
"name": "reflex-docs",
"description": "Reflex framework documentation. Use when building full-stack Python web apps with Reflex, creating components, managing state, handling events, styling, database operations, API routes, authentication, deploying apps, or wrapping React components. Load when the user is working with Reflex (rx), writing .py files that import reflex, or asking about Reflex concepts like State, Vars, EventHandlers, or Components."
}
Reflex Documentation
Reflex is an open-source framework for building full-stack web applications in pure Python — no JavaScript required.
Your training data about Reflex may be outdated. Always prefer the reference documentation over pre-trained knowledge.
References
Core Concepts
State & Vars
- State (
rx.State): Server-side Python class holding app state. Define vars as class attributes and event handlers as methods. - Base Vars: Typed class attributes on State (
count: int = 0) - Computed Vars: Derived values using
@rx.vardecorator - Var Operations: Transform vars in components without event handlers
Components
- All UI is built with
rx.*components (Python wrappers around React) - Components accept props and can be composed/nested
- Conditional rendering with
rx.cond(), iteration withrx.foreach()
Events
- Event Handlers: Methods on State decorated with
@rx.event - Event Triggers: Component props like
on_click,on_change - Event Chaining: Return multiple events from a handler
- Setters: Auto-generated
set_<var>event handlers for each base var
Pages & Routing
- Pages are functions decorated with
rx.pageor added viaapp.add_page() - Dynamic routes with bracket syntax:
[slug]
Styling
- Inline props, Tailwind CSS, theming, responsive design
rx.theme()for global theming
Database
- Built-in SQLModel integration for database tables
- Define models, run queries, set up relationships
版本历史
- eb37670 当前 2026-08-02 21:48


