Element Exclusion
You can exclude specific elements and their descendants from ruio's border visualization by applying the ruio-exclude class.
Copy < div className = " ruio-exclude " > {/* This content and all descendants will be excluded from ruio */} </ div > Inclusive Exclusion : When you add ruio-exclude to an element, both that element AND all its descendants are excluded
Automatic : The ruio UI controls automatically have this class applied
No Configuration Needed : Just add the class name - ruio handles the rest
Common Use Cases
Excluding Modals
Copy function Modal ({ children }) {
return (
< div className = " ruio-exclude modal-overlay " >
< div className = " modal-content " >
{ children }
</ div >
</ div >
)
} Excluding Navigation
Excluding Fixed Overlays
Multiple Classes
You can combine ruio-exclude with your existing classes:
Or use it with CSS modules:
Environment Configuration
Development vs Production
ruio automatically detects the environment using process.env.NODE_ENV:
Enabling in Production (Demo Apps)
For production demo apps or staging environments, you can override the default behavior:
Use Cases:
Demo applications where you want to showcase ruio
Staging environments for debugging
Production apps where you need to visualize component hierarchy
Note: Only use showInProduction when you intentionally want ruio visible to end users.
Custom Environment Detection
If you need custom environment detection, you can conditionally render the provider:
Or use the showInProduction prop for simpler cases:
Root Element Configuration
ruio automatically detects your application's root element. It tries the following selectors in order:
User's saved selection (from localStorage)
Custom defaultRootSelector prop (if provided)
#app (alternative common pattern)
[data-reactroot] (older React versions)
body > div:first-child (universal fallback)
Custom Root Selector
For non-standard app structures, pass the defaultRootSelector prop:
Common Use Cases:
Manual Selection
You can also manually select a root element at runtime:
Click the crosshair icon (element selection mode)
Click any element to make it the new root
The selection persists across page refreshes
LocalStorage Settings
ruio automatically persists settings to localStorage. You can manually inspect or modify these:
CSS selector for the root element
Inspecting Storage
Clearing Settings
Planned Configuration Features
The following features are planned for future releases:
UI Depth Selection
Control how deep ruio crawls the DOM tree:
Options will include:
Crawl deeper down the DOM tree
Option to crawl up the DOM tree
Simultaneously crawl the DOM upwards and downwards
Customize the color palette used for border visualization:
Keyboard Shortcuts
Keyboard macros for quick access:
Custom Positioning
Control where the ruio UI appears:
TypeScript Configuration
ruio includes full TypeScript support out of the box. No additional configuration needed!
Type Definitions
All types are automatically available when you import from ruio:
If you're building custom controls, you can import the context type:
Always exclude overlays : Modal overlays, tooltips, and fixed elements should use ruio-exclude
Keep it in development only : Let ruio's automatic environment detection handle production
Don't over-exclude : Only exclude elements that interfere with visualization
Use semantic class names : Combine ruio-exclude with descriptive class names for clarity
Need More Configuration?
If you need configuration options not listed here, please:
Open a new issue describing your use case
Last updated 3 months ago