@zamansheikh/percentage-bar
v1.0.0
Published
A customizable, interactive percentage bar React component
Maintainers
Readme
@zamansheikh/percentage-bar
A customizable, interactive percentage bar React component built with TypeScript and Tailwind CSS.
Installation
npm install @zamansheikh/percentage-bar lucide-react tailwind-merge clsx react react-domUsage
import { PercentageBar } from '@zamansheikh/percentage-bar';
function App() {
return (
<div>
<PercentageBar />
</div>
);
}Features
- Drag to adjust percentages interactively.
- Add, delete, and rename items.
- Change item colors from a predefined palette.
- Ensures total percentage remains 100%.
- Minimum 2% per section.
- Responsive design with Tailwind CSS.
Requirements
- React 17 or 18
- Tailwind CSS configured in your project
lucide-reactfor iconstailwind-mergeandclsxfor class name utilities
Development
Clone the repository:
git clone https://github.com/zamansheikh/percentage-bar.git cd percentage-barInstall dependencies:
npm installBuild the package:
npm run build
License
MIT License
Developed by Zaman Sheikh
