Examples
This guide walks you through the example projects included in the ruio repository.
Available Examples
The /examples directory contains working demonstrations of ruio:
vite-simple/ - Minimal starter showing basic setup
blog/ - Realistic blog layout with nested components
Running the Examples
Prerequisites
Clone the ruio repository:
git clone https://github.com/gary-rivera/ruio.git cd ruioInstall dependencies:
npm install
Starting an Example
Run the development server:
This will start Vite's dev server and you can explore the examples in your browser.
Example 1: vite-simple
Location: examples/vite-simple/
What It Demonstrates
This minimal example shows:
Basic ruio setup with
RuioContextProviderSimple component hierarchy
How ruio visualizes nested components
Code Structure
Try It Out
Open the example in your browser
Click the ruio toggle button
Hover over different elements
Click the crosshair icon to enter selection mode
Click any element to make it the root
Example 2: blog
Location: examples/blog/
What It Demonstrates
This realistic example shows:
Complex, nested component structure
Real-world layout patterns (header, sidebar, content, footer)
Multiple levels of component nesting
Using
ruio-excludefor UI elements
Code Structure
Component Hierarchy
Try It Out
Enable ruio with the toggle
Notice how different nesting levels have different colors
Use element selection mode to focus on:
Just the Header
A single BlogPost
The Sidebar
Observe how complex layouts become easier to understand
Real-World Example
For a production example of ruio in action, check out this calculator app.
What It Shows
ruio integrated into a real application
How ruio helps debug calculator layout
Complex button grid visualization
State management with visual feedback
Creating Your Own Example
Want to test ruio in your own project? Here's a quick template:
Common Patterns
Pattern 1: Modal with Exclusion
Pattern 2: Conditional Rendering
Pattern 3: List Rendering
Tips for Examples
Start Simple: Begin with the
vite-simpleexample to understand basicsGraduate to Complex: Move to the
blogexample for real-world patternsExperiment: Modify the examples to test different scenarios
Use Selection Mode: Practice using element selection to focus on specific components
Exclude Strategically: Try adding
ruio-excludeto different elements to see the effect
Troubleshooting Examples
Example Won't Start
Ruio Not Appearing
Check that
NODE_ENVis not set to'production'Verify
RuioContextProvideris wrapping your componentsCheck browser console for errors
Borders Not Showing
Make sure ruio is enabled (click the toggle)
Check that elements don't have
ruio-excludeclassVerify your components are descendants of
RuioContextProvider
Next Steps
Read the Usage Guide for detailed feature explanations
Check the API Reference for technical documentation
Review Configuration for customization options
Last updated
Was this helpful?
