⚠️ NOTE: This package is in very early stage of development. NOT recommended for production use yet.
Numpad component for your React app.
View Demo
·
Report Bug
·
Request Feature
·
Ask a question
mui-numpad is available as an npm package.
// with npm
npm install mui-numpad
// with yarn
yarn add mui-numpad
import React, { useState } from 'react';
import { makeStyles } from '@material-ui/core/styles';
import { Grid, TextField } from '@material-ui/core';
import MuiNumpad from 'mui-numpad';
const useStyles = makeStyles((theme) => ({
gridItem: {
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
},
textField: {
width: '100%',
}
}));
function SimpleNumpad() {
const classes = useStyles();
const [value, setValue] = useState();
const onChange = (_value) => {
setValue(_value);
}
return (
<Grid container spacing={2}>
<Grid item className={classes.gridItem} xs={3}>
<TextField
margin="dense"
className={classes.textField}
value={value}
variant="outlined" />
</Grid>
<Grid item xs={3}>
<MuiNumpad
onChange={onChange}
/>
</Grid>
</Grid>
);
}
export default SimpleNumpad;
Name | Type | Default | Description |
---|---|---|---|
onChange | func |
Callback fired when the value is changed. function(value: string) => string value: The value that has been entered. Value is concatenated internally, so with each input you will be getting full value entered so far. |
|
onKeyPress | func |
Callback fired when the key is pressed. function(value: string) => string value: The value of a button that has been pressed. |
Numpad component for your React app.
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Jasmin Mustafic
Gmail:
mustaficjasmin7@gmail.com
Patreon:
https://www.patreon.com/dotundefined
Linkedin:
https://www.linkedin.com/in/jasmin-mustafic-126141151/