@gleb.askerko/componentkit-js
v1.0.10
Published
Lightweight, framework-agnostic JavaScript component library with progress gift components
Downloads
156
Maintainers
Readme
ComponentKit.js
A lightweight, framework-agnostic JavaScript component library designed for modern web applications.
Features
- ProgressGift Component: Gamified progress tracking with point accumulation and reward systems
- Framework Agnostic: Works with any web framework or vanilla JavaScript
- Lightweight: Minimal dependencies and small footprint
- Version Display: Built-in version indicator for debugging and compatibility
- Customizable: Flexible styling and configuration options
Installation
npm install @gleb.askerko/componentkit-jsQuick Start
ProgressGift Component
import { ProgressGift } from '@gleb.askerko/componentkit-js';
// Create a progress gift component
const progressGift = new ProgressGift({
maxPoints: 100,
giftIcon: '🎁',
showVersion: true // Shows v1.0.0 in top-left corner
});
// Render to DOM
progressGift.render('#progress-container');
// Add points
progressGift.addPoints(25);Configuration Options
const progressGift = new ProgressGift({
maxPoints: 100, // Points needed for each gift
giftIcon: '🎁', // Gift emoji/icon
showVersion: true, // Show version badge (default: true)
className: 'custom-class' // Additional CSS classes
});API Methods
render(selector)- Mount component to DOM elementaddPoints(amount)- Add points with animationrestart()- Reset component to initial stateinitProgressGift()- Initialize/reinitialize component
Styling
The component comes with built-in CSS classes that you can customize:
.ck-progress-gift-wrapper- Main container.ck-progress-gift-bar- Progress bar.ck-progress-gift-fill- Progress fill.ck-progress-version- Version badge (top-left corner)
Version Information
Every component displays its version (v1.0.0) in the top-left corner by default. This can be disabled by setting showVersion: false.
Browser Support
- Modern browsers (ES6+ support)
- Chrome 60+
- Firefox 55+
- Safari 12+
- Edge 79+
License
MIT License - see LICENSE file for details.
