A React hook for managing counters

Usage no npm install needed!

<script type="module">
  import chakraXuiCounter from 'https://cdn.skypack.dev/@chakra-xui/counter';



A React hook that provides simple and advance counter functionalities. Mostly used to create numeric inputs and countdown timers.


yarn add @chakra-xui/counter

# or

npm i @chakra-xui/counter

Import hook

import { useCounter } from "@chakra-xui/counter"

Basic usage

export function Example() {
  const counter = useCounter({
    max: 10,
    min: 0,
    step: 0.1,

  return (
      <button onClick={() => counter.increment()}>Increment</button>
      <button onClick={() => counter.decrement()}>Decrement</button>