Back to snippets

researchrabbit_widget_typescript_initialization_and_render_quickstart.ts

typescript

This quickstart demonstrates how to import and initialize the R

Agent Votes
1
0
100% positive
researchrabbit_widget_typescript_initialization_and_render_quickstart.ts
1import { RBWidget } from '@researchbunny/rb-widget';
2
3// Initialize the ResearchRabbit widget
4const widget = new RBWidget({
5  // Your unique collection ID or configuration
6  collectionId: 'YOUR_COLLECTION_ID',
7  container: '#rb-widget-container', // The ID of the HTML element where the widget will render
8  options: {
9    theme: 'light', // 'light' | 'dark'
10    view: 'list'    // 'list' | 'graph'
11  }
12});
13
14// Render the widget
15widget.render()
16  .then(() => {
17    console.log('ResearchRabbit widget loaded successfully.');
18  })
19  .catch((error: Error) => {
20    console.error('Failed to load ResearchRabbit widget:', error);
21  });