Installation
Package Managers
You can install ruio using your preferred package manager:
# npm
npm install ruio
# yarn
yarn add ruio
# bun
bun add ruio
React: 16.8+ (hooks support required)
TypeScript: 4.0+ (optional, but types are included)
TypeScript Setup
ruio is written in TypeScript and includes type definitions out of the box. No additional @types package is needed.
After installation, verify the package is installed correctly:
Root Element Detection
ruio automatically detects your application's root element using common patterns. It tries to find elements in this order:
User's saved selection (from previous session via localStorage)
Custom defaultRootSelector prop (if provided)
#root (most common in React apps)
#app (alternative common pattern)
[data-reactroot] (older React versions)
body > div:first-child (universal fallback)
Most React apps work out of the box with no configuration:
For non-standard app structures, pass the defaultRootSelector prop:
Troubleshooting
Peer Dependency Warnings
If you see peer dependency warnings, ensure you have React installed:
Version Conflicts
If you encounter version conflicts with React:
Check your React version: npm list react
Ensure React is 16.8 or higher
Update React if needed: npm install react@latest react-dom@latest
Module Not Found
If you get "Module not found" errors:
Clear your package manager cache:
Delete node_modules and reinstall:
Root Element Not Found
If you see a console warning about not finding a root element:
Check your HTML: Ensure you have a root element with id="root" or id="app"
Use custom selector: Pass the defaultRootSelector prop with your actual root element's selector
Use element selection mode: Click the crosshair icon in the ruio UI to manually select a root element
Once installed, head over to the Usage Guide to get started with ruio.
Last updated