Configuration
Element Exclusion
You can exclude specific elements and their descendants from ruio's border visualization by applying the ruio-exclude class.
Basic Usage
<div className="ruio-exclude">{/* This content and all descendants will be excluded from ruio */}</div>How It Works
Inclusive Exclusion: When you add
ruio-excludeto an element, both that element AND all its descendants are excludedAutomatic: 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
function Modal({ children }) {
return (
<div className="ruio-exclude modal-overlay">
<div className="modal-content">
{children}
</div>
</div>
)
}Excluding Navigation
Excluding Third-Party Widgets
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
Auto-Detection
ruio automatically detects your application's root element. It tries the following selectors in order:
User's saved selection (from localStorage)
Custom
defaultRootSelectorprop (if provided)#root(most common)#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:
Enable ruio
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:
Storage Keys
ruio_enabled
boolean
Whether ruio is enabled
ruio_root_selector
string
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
Color Theming
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:
Custom Types
If you're building custom controls, you can import the context type:
Best Practices
Always exclude overlays: Modal overlays, tooltips, and fixed elements should use
ruio-excludeKeep 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-excludewith descriptive class names for clarity
Need More Configuration?
If you need configuration options not listed here, please:
Check the GitHub issues to see if it's been requested
Open a new issue describing your use case
Contribute! See the Contributing Guide
Last updated
Was this helpful?
