packsui
v2.0.1
Published
[![npm version](https://badge.fury.io/js/packsui.svg)](https://www.npmjs.com/package/packsui) [![License](https://img.shields.io/badge/license-ISC-blue.svg)](https://opensource.org/licenses/ISC)
Downloads
4
Readme
packsui
A lightweight TypeScript package providing a customizable counter component and hook for easy integration into React projects.
Installation
Install the package via npm:
npm install packsui
Features
- Counter Component: Render a customizable counter component.
- useCounter Hook: Manage stateful counters with a simple hook interface.
- TypeScript Support: Enjoy type safety and autocompletion in your TypeScript projects.
Usage
Counter Component
import React from 'react';
import { Counter } from 'packsui';
const MyComponent = () => {
return (
<div>
<Counter initialValue={0} />
</div>
);
};
export default MyComponent;
useCounter Hook
import React from 'react';
import { useCounter } from 'packsui';
const MyComponent = () => {
const { count, increment, decrement } = useCounter();
return (
<div>
<p>Count: {count}</p>
<button onClick={increment}>Increment</button>
<button onClick={decrement}>Decrement</button>
</div>
);
};
export default MyComponent;
Documentation
For more detailed usage instructions and customization options, please refer to the documentation.
Version
1.0.9
License
This project is licensed under the ISC License - see the LICENSE file for details.
Acknowledgements
- This package was inspired by example project.
- Special thanks to contributors who helped improve this package.
Keywords
TypeScript, JavaScript, React