₿ Bitcoin Widgets Demo

Reusable components for live Bitcoin data

Minimal View

Perfect for navigation bars and compact spaces. Shows only price and 24h change.

Demo

Implementation

new LiveMarketData({ container: '#minimal-demo', view: 'minimal', refreshInterval: 60000 });

Compact View

Balanced display with price and change, ideal for sidebars and cards.

Demo

Implementation

new LiveMarketData({ container: '#compact-demo', view: 'compact', showChange: true, refreshInterval: 60000 });

Full View

Complete market statistics including price, market cap, volume, and dominance.

Demo

Implementation

new LiveMarketData({ container: '#full-demo', view: 'full', showChange: true, showMarketCap: true, showVolume: true, showDominance: true, refreshInterval: 60000, onUpdate: function(data) { console.log('Price updated:', data.price); }, onError: function(error) { console.error('Error:', error); } });

API Handler

Direct access to Bitcoin data through the centralized API handler.

Available Methods

Cache Statistics

Integration Examples

Common use cases and integration patterns.

Navigation Bar Integration

<nav> <div class="logo">Your Site</div> <div id="nav-price"></div> </nav> <script> new LiveMarketData({ container: '#nav-price', view: 'minimal', refreshInterval: 30000 }); </script>

Dashboard with Multiple Widgets

// Shared API handler for efficiency const api = new BitcoinAPIHandler(); // Header price new LiveMarketData({ container: '#header-price', view: 'minimal', apiHandler: api }); // Dashboard stats new LiveMarketData({ container: '#dashboard-stats', view: 'full', apiHandler: api }); // Footer stats new LiveMarketData({ container: '#footer-stats', view: 'compact', apiHandler: api });