Installation
Get started with Reflex UI by installing the package and configuring Tailwind CSS in your Reflex project.Prerequisites
Before installing Reflex UI, ensure you have:- Python 3.11 or higher
- Reflex 0.8.0 or higher
If you don’t have a Reflex project yet, follow the Reflex Getting Started guide first.
Install Reflex UI
Install the package
Choose your preferred package manager to install Reflex UI:This will install Reflex UI and its dependencies, including Reflex itself.
Enable Tailwind CSS v4 Plugin
Reflex UI requires Tailwind CSS v4 for styling. Add the Tailwind plugin to your
rxconfig.py:rxconfig.py
Create your Tailwind CSS configuration
Create a
globals.css file in your assets/css/ directory with the Reflex UI theme configuration:assets/css/globals.css
This is a minimal configuration. For the complete configuration with all Radix color variables, check the demo globals.css file.
Verify Installation
To verify that Reflex UI is installed correctly, try importing and using a component:http://localhost:3000.
Customizing Your Theme
Changing the Primary Color
To change the primary color, modify the CSS variables in yourglobals.css:
gray, mauve, slate, sage, olive, sand, tomato, red, ruby, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, teal, jade, green, grass, brown, orange, amber, yellow, lime, mint, sky.
Adjusting Border Radius
Change the--radius variable to adjust the border radius across all components:
Next Steps
Quickstart Guide
Build your first Reflex UI component
Browse Components
Explore all available components
Troubleshooting
Components are not styled correctly
Components are not styled correctly
Make sure you:
- Added the
TailwindV4Pluginto yourrxconfig.py - Created the
globals.cssfile with the theme configuration - Linked the stylesheet in your app with
stylesheets=["css/globals.css"] - Restarted your Reflex development server
Import errors
Import errors
Verify that:
- You have Python 3.11 or higher
- Reflex 0.8.0 or higher is installed
- You’ve installed
reflex-uiwithpip install reflex-ui
Dark mode not working
Dark mode not working
Reflex UI supports dark mode out of the box. Use the
theme_switcher component to toggle between light and dark modes. Make sure your CSS includes the @custom-variant dark rule.