Overview
React Grab’s theming system allows you to customize the visual appearance of the overlay, selection boxes, labels, and other UI elements. The theme uses an HSL color space with a configurable base hue for consistent color generation.Theme Interface
TheTheme interface defines all customizable visual elements:
Globally toggle the entire overlay. When
false, React Grab functionality is disabled but the API remains available.Base hue (0-360) used to generate colors throughout the interface using HSL color space.Examples:
0- Red120- Green240- Blue280- Purple
Selection Box
The highlight box that appears when hovering over an element before selecting it.
Drag Box
The rectangular selection area that appears when clicking and dragging to select multiple elements.
Grabbed Boxes
Brief flash/highlight boxes that appear on elements immediately after they’re successfully grabbed/copied.
Element Label
The floating label that follows the cursor showing information about the currently hovered element.
Crosshair
The crosshair cursor overlay that helps with precise element targeting.
Toolbar
The floating toolbar that allows toggling React Grab activation.
Applying Themes
Via Plugin
The recommended way to apply themes is through a plugin:Via Init Options
You can also pass theme options when initializing React Grab:Dynamic Theme Updates
Themes can be updated dynamically through plugins:DeepPartial Type
React Grab uses aDeepPartial type for theme overrides, allowing you to specify only the properties you want to change:
Theme Examples
Minimal Theme
Disable all visual indicators except the selection box:High Contrast Theme
Use a bright color for better visibility:Brand Color Theme
Match your brand colors:Stealth Mode
Minimize visual distraction:Color System
Thehue value determines the base color using the HSL color model:
| Hue Range | Color |
|---|---|
| 0-30 | Red |
| 30-60 | Orange |
| 60-120 | Yellow/Green |
| 120-180 | Green |
| 180-240 | Cyan/Blue |
| 240-280 | Blue |
| 280-330 | Purple/Magenta |
| 330-360 | Pink/Red |
Multiple Theme Plugins
You can register multiple plugins with theme overrides. Themes are merged in the order plugins are registered:Best Practices
- Use Named Plugins: Give theme plugins descriptive names for easier debugging
- Partial Updates: Only override the properties you need to change
- Consistent Hues: Stick to a single hue value for visual consistency
- Test Visibility: Ensure your theme provides sufficient contrast on your application’s background
- Consider Accessibility: High contrast themes help users with visual impairments
See Also
- Plugins - Plugin system overview
- Custom Actions - Adding custom functionality
- API Reference - Initialization options
