| name | reflex |
| description | Build and debug Reflex (rx) UIs in this repo. Use for editing ui/*.py, choosing rx components, fixing Var/conditional/foreach issues, and applying responsive/layout patterns from the Reflex docs. |
Reflex UI Skill
Use this skill whenever the task involves Reflex UI code (ui/*.py), rx components, state vars, event handlers, or front-end layout/styling issues.
Quick rules
- Never use Python
if/elsewith state vars in component trees. Userx.condorrx.match. - Never use Python
forloops over state vars in component trees. Userx.foreach. - Var operations use bitwise operators:
&,|,~for logic. - Selects: use
rx.select(["a", "b"])or therx.select.rootfamily (norx.option). - Responsive: prefer
rx.breakpoints(...)on props (e.g.,columns=rx.breakpoints(...)). - Layout: use
rx.gridfor grids,rx.flexfor rows/columns.
When debugging compile errors
- Look for
VarTypeErroror "Cannot convert Var to bool" and replaceif/or/andwithrx.cond/&/|/~. - If a list/iterable is a state var, render it with
rx.foreach(do notjoin()or list‑comprehend in Python). - For responsive direction/columns, use
rx.breakpointsinstead of lists.
Reference files
- Library component patterns: references/library.md
- Conditional + foreach rules: references/components.md
- Responsive rules + breakpoints: references/styling.md
- State vars + setters guidance: references/state.md
- Examples & patterns from
/Users/eric/git/reflex-examples: references/examples.md