Overview
The OneBalance onboarding system provides a comprehensive user education experience through multiple components working together:- OnboardingProvider: Context provider for managing onboarding state
- WelcomeModal: Multi-slide welcome experience for first-time users
- OnboardingTooltip: Interactive tooltips that guide users through key features
- ContextualHelp: Hover/click help icons for specific features
- HelpMenu: Centralized help and support menu
Components
OnboardingProvider
The context provider that manages all onboarding state and provides methods to control the tour.Import
Setup
App Setup
Hook API
State Interface
WelcomeModal
A multi-slide modal that greets first-time users and introduces key features.Import
Features
- 4 informational slides: Welcome, features, security, chain-abstraction
- Auto-detection: Only shows to first-time users
- Route-aware: Adapts tour based on current page (swap vs transfer)
- LocalStorage persistence: Remembers if user has seen it
Usage
Slide Content
- Welcome
- Speed
- Security
- Chain Abstraction
OnboardingTooltip
Interactive tooltips that guide users through the application step-by-step.Import
Features
- Smart positioning: Automatically repositions to stay in viewport
- Element highlighting: Highlights target elements during tour
- Progress indicator: Visual progress bar
- Navigation controls: Next, back, and skip buttons
- Backdrop overlay: Dims background to focus attention
Target Elements
Adddata-onboarding attributes to elements you want to highlight:
Swap Tour Steps
ContextualHelp
Small help icons that show tooltips with detailed explanations.Import
Props
string
required
The title of the help tooltip.
string
required
The detailed explanation text.
'info' | 'warning' | 'tip' | 'feature'
default:"info"
The type of help, which affects icon and styling.
'hover' | 'click'
default:"hover"
How the tooltip is triggered.
'top' | 'bottom' | 'left' | 'right'
default:"top"
Preferred tooltip position relative to the trigger.
React.ReactNode
Custom trigger element. If not provided, uses a default help icon.
Usage Examples
Predefined Help Content
The component includes commonly used help content:HelpMenu
Centralized help and support menu accessible from anywhere in the app.Import
Features
- Guided tour restart: Launch the onboarding tour anytime
- Tutorial reset: Reset progress to see welcome modal again
- Quick help cards: Common questions and answers
- External links: Documentation and community support
- Support contact: Discord and email links
Usage
Quick Help Topics
- Login: How to create an account
- Make a Swap: Steps to execute a swap
- Chain-Abstracted: Explanation of multi-chain functionality
- Gasless: Information about sponsored transactions
Complete Integration Example
Complete App Setup
State Persistence
Onboarding state is persisted to localStorage:Customization
Custom Tour Steps
You can modify the tour steps by editingOnboardingProvider.tsx:
Custom Steps
Styling
All components use Tailwind CSS and support dark mode:Custom Styling
Best Practices
Keep tooltip descriptions concise (1-2 sentences) for better readability on mobile devices.
Related Components
- SwapForm - Primary tour target
- ConnectButton - Often an early tour step