react-mui-counter
Version:
React Material Counter
37 lines (26 loc) • 1.52 kB
Markdown
//mui.com/)
```javascript
import React from 'react'
import Counter from 'react-mui-counter'
const Demo = ()=>{
return <Counter/>
}
export default Demo
```
The name `Counter` can be used when providing default props or style overrides in the theme.
Props of the [TextField](https://mui.com/api/text-field/) component are also available.
| Name | Type | Default | Description |
| ----------- | ----------- | ----------- | ----------- |
| **value** | `number` | 0 | The value of the `input` element, required for a controlled component. |
| **onChange** | `func` | | Callback fired when the value is changed. **Signature:**`function(event: object) => void``event`: The event source of the callback. You can pull out the new value by accessing `event.target.value` (number). |
| **sx** | `Array<func or object or bool> or func or object` | | The system prop that allows defining system overrides as well as additional CSS styles. See the [sx page](https://mui.com/system/the-sx-prop/) for more details. |
| **size** | `'normal' or 'small'` | | The size of the component. |
| **disabled** | `boolean` | | Sets the whether the control is disabled |
**Note: This component can also be used with [React Hook Form](https://react-hook-form.com/get-started)**
[ ](https: