mui-numpad
v0.1.4-alpha
Published
<!-- PROJECT LOGO --> > ⚠️ **NOTE: This package is in very early stage of development. NOT recommended for production use yet.**
Downloads
13
Maintainers
Readme
⚠️ NOTE: This package is in very early stage of development. NOT recommended for production use yet.
Table of Contents
Getting Started
mui-numpad is available as an npm package.
Installation
// with npm
npm install mui-numpad
// with yarn
yarn add mui-numpad
Usage
Simple 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;
Props
| 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. |
About The Project
Numpad component for your React app.
Built With
Roadmap
See the open issues for a list of proposed features (and known issues).
Contributing
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
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
Jasmin Mustafic
Gmail:
[email protected]
Patreon:
https://www.patreon.com/dotundefined
Linkedin:
https://www.linkedin.com/in/jasmin-mustafic-126141151/