zenitu-ui
v1.0.4
Published
A simple and lightweight React UI component library featuring a custom `useCounter` hook to streamline counter functionality in your applications.
Downloads
115
Readme
zenitu-ui
A simple and lightweight React UI component library featuring a custom useCounter
hook to streamline counter functionality in your applications.
Installation
Install the zenitu-ui
package using npm or yarn:
npm:
npm install zenitu-ui
Usage
useCounter Hook
The useCounter hook provides a state management solution for counters, including functions to increment and decrement the value. This simplifies building counter components in your React applications.
Importing useCounter:
```bash
import { useCounter } from 'zenitu-ui';
```bash
import React from 'react';
import { useCounter } from 'zenitu-ui';
const CounterComponent = () => {
const { count, increment, decrement } = useCounter();
return (
<div>
<h1>Counter: {count}</h1>
<button onClick={increment}>Increment</button>
<button onClick={decrement}>Decrement</button>
</div>
);
};
export default CounterComponent;