@bianic-ui/counter
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-alpha.2 • Public • Published

Counter

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

Installation

yarn add @bianic-ui/counter

# or

npm i @bianic-ui/counter

Import hook

import { useCounter } from "@bianic-ui/counter"

Basic usage

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

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

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @bianic-ui/counter

    Weekly Downloads

    2

    Version

    0.1.0-alpha.2

    License

    MIT

    Unpacked Size

    40.6 kB

    Total Files

    14

    Last publish

    Collaborators

    • ilmimris