{"id":13403865,"url":"https://github.com/gpietro/react-numpad","last_synced_at":"2026-01-11T03:39:06.385Z","repository":{"id":55997426,"uuid":"111151042","full_name":"gpietro/react-numpad","owner":"gpietro","description":"A numpad for number, date and time, built with and for React.","archived":false,"fork":false,"pushed_at":"2020-12-02T08:50:56.000Z","size":5505,"stargazers_count":135,"open_issues_count":12,"forks_count":38,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-23T13:57:02.925Z","etag":null,"topics":["calendar","datepicker","number-input","numpad","react","timepicker"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gpietro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-17T21:11:36.000Z","updated_at":"2024-04-10T06:53:34.000Z","dependencies_parsed_at":"2022-08-15T11:01:07.097Z","dependency_job_id":null,"html_url":"https://github.com/gpietro/react-numpad","commit_stats":null,"previous_names":[],"tags_count":97,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpietro%2Freact-numpad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpietro%2Freact-numpad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpietro%2Freact-numpad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpietro%2Freact-numpad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gpietro","download_url":"https://codeload.github.com/gpietro/react-numpad/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221137441,"owners_count":16762741,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calendar","datepicker","number-input","numpad","react","timepicker"],"created_at":"2024-07-30T19:01:35.651Z","updated_at":"2024-10-25T18:32:45.071Z","avatar_url":"https://github.com/gpietro.png","language":"JavaScript","funding_links":["https://opencollective.com/react-numpad","https://opencollective.com/react-numpad/contribute","https://opencollective.com/react-numpad/organization/0/website","https://opencollective.com/react-numpad/organization/1/website","https://opencollective.com/react-numpad/organization/2/website","https://opencollective.com/react-numpad/organization/3/website","https://opencollective.com/react-numpad/organization/4/website","https://opencollective.com/react-numpad/organization/5/website","https://opencollective.com/react-numpad/organization/6/website","https://opencollective.com/react-numpad/organization/7/website","https://opencollective.com/react-numpad/organization/8/website","https://opencollective.com/react-numpad/organization/9/website"],"categories":["JavaScript","UI Components"],"sub_categories":["Form Components"],"readme":"![Logo of the project](https://raw.githubusercontent.com/gpietro/react-numpad/master/logo.png)\n\n# React numpad\n\n[![Financial Contributors on Open Collective](https://opencollective.com/react-numpad/all/badge.svg?label=financial+contributors)](https://opencollective.com/react-numpad) [![Greenkeeper badge](https://badges.greenkeeper.io/gpietro/react-numpad.svg)](https://greenkeeper.io/)\n[![BCH compliance](https://bettercodehub.com/edge/badge/gpietro/react-numpad?branch=master)](https://bettercodehub.com/)\n[![npm version](https://badge.fury.io/js/react-numpad.svg)](https://badge.fury.io/js/react-numpad)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md#pull-requests)\n\nA numpad for number, date and time, built with and for React.\nIt's written with the extensibility in mind. The idea of this project is to cover the majority of input types in a form.\n\n## Demo / Examples\n\nLive demo: [gpietro.github.io/react-numpad-demo](https://gpietro.github.io/react-numpad-demo)\n\n## Installation\n\nTo use React-Numpad, install it from NPM and include it in your own React build process (using Webpack, etc).\n\n```shell\nnpm install --save react-numpad\n```\n\nAt this point you can import react-numpad in your application\n\n```shell\nimport NumPad from 'react-numpad';\n```\n\n## Usage\n\nReact-NumPad generates an input field containing the selected value, so you can submit it as part of a standard form. You can also listen for changes with the onChange event property.\nWhen the value is changed, onChange(selectedValue) will fire.\n\nReact-NumPad is built based on a \"main\" component (NumPad.js). Following the higher-order component technique, is possible to create new components by simply overriding few common properties.\n\n| Property      | Type                 | Default      | Description                                                                                                                        |\n| :------------ | :------------------- | :----------- | :--------------------------------------------------------------------------------------------------------------------------------- |\n| `onChange`    | `function`           | **required** | function called when value change and is valid.                                                                                    |\n| `placeholder` | `string`             | none         | text to display as input placeholder.                                                                                              |\n| `label`       | `string`             | none         | text to display as input label.                                                                                                    |\n| `position`    | `string`             | `flex-end`   | Position to the screen. `center`, `flex-start`, `flex-end`, `startBottomLeft`, `startBottomRight`, `startTopLeft`, `startTopRight` |\n| `theme`       | `string` or `object` | `numpad`     | string as the name of the theme or object as custom styles.                                                                        |\n| `value`       | `string` or `number` | none         | value (default) for the input field.                                                                                               |\n| `sync`        | `boolean`            | false        | if true, callbacks calls while typing if the input is valid                                                                        |\n| `inline`      | `boolean`            | false        | show the component inline always visible without input field.                                                                      |\n| `keyValidator` | `function` |         | Validates the enabled keys while typing. **Only for Number**  |\n| `displayRule`           | `function` |         | Format the output value                  |\n\n### NumPad.Number\n\nInput field for numeric value.\n\n| Property   | Type                  | Default  | Description                                                                   |\n| :--------- | :-------------------- | :------- | :---------------------------------------------------------------------------- |\n| `decimal`  | `boolean` or `number` | **true** | True allows decimal numbers or is possible to specify the number of decimals. |\n| `negative` | `bolean`              | **true** | True allows negative numbers                                                  |\n\n```shell\n\u003cNumPad.Number\n    onChange={(value) =\u003e { console.log('value', value)}}\n    label={'Total'}\n    placeholder={'my placeholder'}\n    value={100}\n    decimal={2}\n/\u003e\n```\n\n### NumPad.DateTime\n\nInput field for date and time format.\n\n| Property     | Type     | Default          | Description                                                                                    |\n| :----------- | :------- | :--------------- | :--------------------------------------------------------------------------------------------- |\n| `dateFormat` | `string` | **'DD.MM.YYYY'** | Specify the date time format based on moment.js. Ex: 'DD.MM.YYYY', 'HH:mm', 'YYYY-MM-DD HH:mm' |\n\n```shell\n\u003cNumPad.DateTime\n    onChange={(value) =\u003e { console.log('value', value)} }\n    dateFormat=\"DD.MM.YYYY HH:mm\"\n    label={'Input for date and time'}\n/\u003e\n\n\u003cNumPad.DateTime\n    onChange={(value) =\u003e { console.log('value', value)} }\n    dateFormat=\"HH:mm\"\n    label={'Input for time'}\n/\u003e\n```\n\n### NumPad.Calendar\n\nCalendar input field.\n\n| Property     | Type     | Default      | Description                                                                                                 |\n| :----------- | :------- | :----------- | :---------------------------------------------------------------------------------------------------------- |\n| `dateFormat` | `string` | `MM/DD/YYYY` | specify a different date format.                                                                            |\n| `locale`     | `string` | `en`         | locale for days and months                                                                                  |\n| `weekOffset` | `number` | `0`          | First day of the week, by default is Sunday                                                                 |\n| `markers`    | `array`  | []           | list of dates to place a marker on Calendar. The string date format must be the same as dateFormat property |\n| `min`        | `string` | none         | min value for validation                                                                                    |\n| `max`        | `string` | none         | max value for validation                                                                                    |\n\n```shell\n\u003cNumPad.Calendar\n    onChange={value =\u003e console.log('changed', value)}\n    label='Data di nascita'\n    locale=\"it\"\n    dateFormat=\"DD.MM.YYYY\"\n    min=\"01.01.1900\"\n    markers={['01.03.2018', '06.03.2018']}\n/\u003e\n```\n\n\u003e **Version \u003e 4.1.0**\n\n#### NumPad.Calendar with Times Picker ( can pick only hours for now )\n\n| Property     | Type     | Default            | Description                               |\n| :----------- | :------- | :----------------- | :---------------------------------------- |\n| `dateFormat` | `string` | `MM/DD/YYYY HH:mm` | specify a different date format and time. |\n\n### NumPad.Appointment\n\nAvailable date time appointments picker.\n\n| Property           | Type     | Default      | Description                                    |\n| :----------------- | :------- | :----------- | :--------------------------------------------- |\n| `appointmentDates` | `object` | **required** | object representing available dates with times |\n| `dateFormat`       | `string` | `MM/DD/YYYY` | specify a different date format.               |\n| `locale`           | `string` | `en`         | locale for days and months                     |\n\n```shell\n\u003cNumPad.Appointment\n    dateFormat={\"DD.MM.YYYY\"}\n    dates={appointmentDates}\n    locale={\"it\"}\n    onChange={value =\u003e console.log(\"value\", value)}\n/\u003e\n\nconst appointmentDates = {\n    '01.04.2018': ['08:00', '09:00', '10:00', '11:00'],\n    '03.04.2018': ['08:00', '09:00', '10:00'],\n    '04.04.2018': ['08:00', '09:00', '10:00', '11:00', '17:00'],\n    '09.04.2018': ['08:00', '10:00', '11:00', '15:00']\n}\n```\n\n## Custom input\n\nIt's possible to override the InputField component by passing your input field as child component of NumPad.\n\n```shell\n\u003cNumPad.Number onChange={(value) =\u003e console.log('value', value)}\u003e\n    \u003cbutton\u003eClick me!\u003c/button\u003e\n\u003c/NumPad.Number\u003e\n```\n\n## Themes\n\nThere is only one theme available for now, in /styles folder, **numpad**.\nAny css style is customizable using styled components.\n\nIt is possible to override a theme by defining an object with the theme properties:\n\n```shell\nconst myTheme = {\n  header: {\n    primaryColor: '#263238',\n    secondaryColor: '#f9f9f9',\n    highlightColor: '#FFC107',\n    backgroundColor: '#607D8B',\n  },\n  body: {\n    primaryColor: '#263238',\n    secondaryColor: '#32a5f2',\n    highlightColor: '#FFC107',\n    backgroundColor: '#f9f9f9',\n  },\n  panel: {\n    backgroundColor: '#CFD8DC'\n  }\n};\n\n\n\u003cNumPad.Number theme={myTheme}\u003e\n```\n\n## Keyboard support\n\n`0, 1, 2, ... 9`: input number.\n\n`- and .`: input symbol.\n\n`Esc`: close keypad or calendar.\n\n`Enter`: submit value.\n\n## Calendar swipe support\n\nOn mobile is possible to switch between months by swipe.\n\n## Developing\n\n```shell\ngit clone git@github.com:gpietro/react-numpad.git\ncd react-numpad/\nnpm install\nnpm start\nnpm run storybook\n```\n\nVisit localhost:6006 to see the NumPad components available so far.\n\n### Build\n\n```shell\nnpm run build\n```\n\nA bundle will be created in the dist directory.\n\n## Contribute\n\nIf you'd like to contribute, please fork the repository and use a feature\nbranch. Pull requests are warmly welcome.\n\nSee our [CONTRIBUTING.md](https://github.com/gpietro/react-numpad/blob/master/CONTRIBUTING.md) for information on how to contribute.\n\n## Contributors\n\n### Code Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\u003ca href=\"https://github.com/gpietro/react-numpad/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/react-numpad/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\n### Financial Contributors\n\nBecome a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/react-numpad/contribute)]\n\n#### Individuals\n\n\u003ca href=\"https://opencollective.com/react-numpad\"\u003e\u003cimg src=\"https://opencollective.com/react-numpad/individuals.svg?width=890\"\u003e\u003c/a\u003e\n\n#### Organizations\n\nSupport this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/react-numpad/contribute)]\n\n\u003ca href=\"https://opencollective.com/react-numpad/organization/0/website\"\u003e\u003cimg src=\"https://opencollective.com/react-numpad/organization/0/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/react-numpad/organization/1/website\"\u003e\u003cimg src=\"https://opencollective.com/react-numpad/organization/1/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/react-numpad/organization/2/website\"\u003e\u003cimg src=\"https://opencollective.com/react-numpad/organization/2/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/react-numpad/organization/3/website\"\u003e\u003cimg src=\"https://opencollective.com/react-numpad/organization/3/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/react-numpad/organization/4/website\"\u003e\u003cimg src=\"https://opencollective.com/react-numpad/organization/4/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/react-numpad/organization/5/website\"\u003e\u003cimg src=\"https://opencollective.com/react-numpad/organization/5/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/react-numpad/organization/6/website\"\u003e\u003cimg src=\"https://opencollective.com/react-numpad/organization/6/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/react-numpad/organization/7/website\"\u003e\u003cimg src=\"https://opencollective.com/react-numpad/organization/7/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/react-numpad/organization/8/website\"\u003e\u003cimg src=\"https://opencollective.com/react-numpad/organization/8/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/react-numpad/organization/9/website\"\u003e\u003cimg src=\"https://opencollective.com/react-numpad/organization/9/avatar.svg\"\u003e\u003c/a\u003e\n\n## License\n\nMIT Licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpietro%2Freact-numpad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgpietro%2Freact-numpad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpietro%2Freact-numpad/lists"}