@gamaroff/ionic-wizard-bubbles v2.0.5
@gamaroff/ionic-wizard-bubbles
A wizard bubble plugin for Ionic applications that helps guide users through your app's features.
Features
- šÆ Highlight specific elements on the page
- š¬ Show informative bubbles with custom text
- šØ Fully customizable themes
- š± Cross-platform support (Web, iOS*, Android WebView)
- š Step-by-step navigation
- š Optional icons for each step
- š± Smart positioning for mobile screens
- š Debug mode for troubleshooting
*Note: iOS native implementation is currently a stub. Web implementation works in iOS WebView.
Installation
npm install @gamaroff/ionic-wizard-bubblesPlatform Setup
Web
No additional setup required. The plugin works out of the box.
Android (WebView)
The plugin works in Android's WebView environment. For optimal performance:
- Add the viewport meta tag to your
index.html:
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">- Use
ngAfterViewInitfor initialization in your Angular component:
import { Component, AfterViewInit } from '@angular/core';
import { WizardBubble } from '@gamaroff/ionic-wizard-bubbles';
@Component({
selector: 'app-home',
template: `
<ion-content>
<div id="feature1">Feature 1</div>
<div id="feature2">Feature 2</div>
</ion-content>
`
})
export class HomePage implements AfterViewInit {
ngAfterViewInit() {
// Wait for the view to be fully rendered
setTimeout(() => {
WizardBubble.show({
steps: [
{
targetId: 'feature1',
text: 'This is an amazing feature!',
icon: 'š'
},
{
targetId: 'feature2',
text: 'And here is another cool thing!'
}
],
buttonText: {
next: 'Continue',
finish: 'Got it!'
},
theme: {
backgroundColor: '#ffffff',
textColor: '#333333',
buttonColor: '#007bff',
buttonTextColor: '#ffffff',
highlightColor: '#007bff',
borderRadius: '12px'
}
});
}, 1000);
}
}iOS (WebView)
Same setup as Android - the web implementation works in iOS WebView.
Debugging in Android WebView
To view debug logs and troubleshoot issues:
- Connect your Android device to your computer
- Open Chrome on your computer
- Navigate to
chrome://inspect/#devices - Find your app in the list and click "inspect"
- Check the console for detailed logs about element positioning and visibility
API Reference
WizardBubbleOptions Interface
interface WizardBubbleOptions {
steps: WizardBubbleStep[];
buttonText?: {
next?: string;
finish?: string;
};
theme?: {
backgroundColor?: string;
textColor?: string;
buttonColor?: string;
buttonTextColor?: string;
highlightColor?: string;
borderRadius?: string;
};
}
interface WizardBubbleStep {
targetId: string;
text: string;
icon?: string; // Emoji or text icon
}Methods
show(options: WizardBubbleOptions): Promise
Shows the wizard bubble with the specified options. Features include:
- Smart positioning that adjusts based on screen space
- Automatic repositioning for scrolled content
- Touch-optimized for mobile devices
- High z-index to ensure visibility in WebViews
next(): Promise<{ isFinished: boolean }>
Advances to the next step. Returns an object with isFinished indicating whether the wizard has completed.
hide(): Promise
Manually hides the wizard bubble.
Platform Support
| Feature | Web | iOS WebView | Android WebView | iOS Native | Android Native |
|---|---|---|---|---|---|
| Show Bubble | ā | ā | ā | ā ļø | ā ļø |
| Hide Bubble | ā | ā | ā | ā ļø | ā ļø |
| Navigation | ā | ā | ā | ā ļø | ā ļø |
| Theming | ā | ā | ā | ā ļø | ā ļø |
| Element Highlighting | ā | ā | ā | ā ļø | ā ļø |
| Smart Positioning | ā | ā | ā | ā ļø | ā ļø |
ā = Fully supported ā ļø = Stub implementation (no visual elements)
Troubleshooting
Bubble Not Visible
- Check element IDs match exactly
- Ensure the view is fully rendered (use setTimeout)
- Verify z-index conflicts with other elements
- Check Chrome DevTools for error messages
- Ensure the target element is in the viewport
Positioning Issues
- Verify viewport meta tag is present
- Check if target element is properly positioned
- Ensure no CSS transforms affecting positioning
- Check Chrome DevTools console for positioning logs
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT