JSPM

@chakra-ui/counter

2.0.0-next.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 470290
  • Score
    100M100P100Q185297F
  • License MIT

A React hook for managing counters

Package Exports

  • @chakra-ui/counter
  • @chakra-ui/counter/dist/chakra-ui-counter.cjs.js
  • @chakra-ui/counter/dist/chakra-ui-counter.esm.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@chakra-ui/counter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Counter

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

Installation

yarn add @chakra-ui/counter

# or

npm i @chakra-ui/counter

Import hook

import { useCounter } from "@chakra-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>
  )
}