State Management
useCounter
Manage numeric counter state with increment, decrement, and reset functions.
import { useCounter } from "saha-ui"Uses
Simple numeric counter hook with convenient increment/decrement/reset/set functions.
Props
| Name | Type | Description | Default |
|---|---|---|---|
| initialValue | number | Starting value. | 0 |
Returns
| Name | Description |
|---|---|
| count | Current numeric value. |
| increment(), decrement(), reset(), set(value) | State mutation helpers. |
Example
const { count, increment, reset } = useCounter(5); increment();Notes
Useful for small UI counters, retries, or numeric controls.