{"id":19259781,"url":"https://github.com/unicef/material-ui-currency-textfield","last_synced_at":"2025-04-05T05:04:21.140Z","repository":{"id":35075526,"uuid":"203442893","full_name":"unicef/material-ui-currency-textfield","owner":"unicef","description":"Currency textfield for React Material UI ","archived":false,"fork":false,"pushed_at":"2023-03-03T10:38:57.000Z","size":40596,"stargazers_count":117,"open_issues_count":59,"forks_count":95,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-29T04:04:44.632Z","etag":null,"topics":["currency","input","material-design","material-ui","react","textfield"],"latest_commit_sha":null,"homepage":"https://unicef.github.io/material-ui-currency-textfield/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unicef.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-20T19:39:47.000Z","updated_at":"2024-10-19T15:42:38.000Z","dependencies_parsed_at":"2024-06-18T13:51:17.721Z","dependency_job_id":"c8401c74-f1c4-464c-8524-be1379388756","html_url":"https://github.com/unicef/material-ui-currency-textfield","commit_stats":{"total_commits":58,"total_committers":4,"mean_commits":14.5,"dds":0.5172413793103448,"last_synced_commit":"c46ffb12542ca1ce6bd728942bfe8f9decafd0e3"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unicef%2Fmaterial-ui-currency-textfield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unicef%2Fmaterial-ui-currency-textfield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unicef%2Fmaterial-ui-currency-textfield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unicef%2Fmaterial-ui-currency-textfield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unicef","download_url":"https://codeload.github.com/unicef/material-ui-currency-textfield/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289424,"owners_count":20914464,"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":["currency","input","material-design","material-ui","react","textfield"],"created_at":"2024-11-09T19:17:49.602Z","updated_at":"2025-04-05T05:04:21.116Z","avatar_url":"https://github.com/unicef.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Material-ui currency textfield\n[![npm version](https://badge.fury.io/js/%40unicef%2Fmaterial-ui-currency-textfield.svg)](https://badge.fury.io/js/%40unicef%2Fmaterial-ui-currency-textfield)\n\n`CurrencyTextField` is a  [Material-ui](https://material-ui.com/) [react](https://reactjs.org/) component. It provides a user friendly experience while inputing currency numbers. \n\n`CurrencyTextField` wraps the functionality of \u003ca href=\"https://github.com/autoNumeric/autoNumeric\"\u003eautonumeric\u003c/a\u003e and it is a port of \u003ca href=\"https://github.com/mkg0/react-numeric\"\u003ereact-numeric\u003c/a\u003e in Material-ui.\n\n![Example of material](https://raw.githubusercontent.com/unicef/material-ui-currency-textfield/master/material-ui-currency-field.gif)\n\nMain features:\n * Adds thousands separator automatically.\n * Adds automatically the decimals on blur.\n * Smart input. User can only type the accepted characters depending on the current value.\n * Lots of config options...\n\n## Install\n\n ```bash\n npm install @unicef/material-ui-currency-textfield --save\n```\n\n## Usage\n\n**[Documentation and live demo is available here](https://unicef.github.io/material-ui-currency-textfield/)**\n\n\n```jsx\nimport React from 'react'\nimport CurrencyTextField from '@unicef/material-ui-currency-textfield'\n\nexport default function MyComponent() {\n\n  const [value, setValue] = React.useState();\n\n  return (\n    \u003cCurrencyTextField\n\t\tlabel=\"Amount\"\n\t\tvariant=\"standard\"\n\t\tvalue={value}\n\t\tcurrencySymbol=\"$\"\n\t\t//minimumValue=\"0\"\n\t\toutputFormat=\"string\"\n\t\tdecimalCharacter=\".\"\n\t\tdigitGroupSeparator=\",\"\n\t\tonChange={(event, value)=\u003e setValue(value)}\n    /\u003e\n  );\n}\n```\n\n\n## Development\n\nIn order to extend the component, clone the project and install the dependencies.\n```bash\n$ git clone https://github.com/unicef/material-ui-currency-textfield.git\n$ npm install\n```\n\nThe following commands are available: \n\n### `npm start`\n\nBuilds the component outputing it in the `dist` folder. It is refreshed everytime you make changes in the code.\n\n```bash\nnpm start\n```\n\nTo see the output in the browser run the example app ([/example](https://github.com/unicef/material-ui-currency-textfield/tree/master/example))\n\n```bash\n cd example \n npm install (only first time)\n npm start\n ```\nRuns the app in the development mode. Open [http://localhost:3000](http://localhost:3000) to view the app in the browser.\n\nIt will reload automatically upon edits. Lint errors are also displayed on the console.\n\n### `npm run build`\n\nOutputs the build for production to the `dist` folder.\n\n### `npm run styleguide`\nGenerates the documentation available on.\n\nOpen [http://localhost:6060](http://localhost:6060) to view it in the browser.\n\nIt watches for changes and automatically reloads the browser.\n\nWe use [styleguidelist](https://react-styleguidist.js.org/) for documenting our custom components.\n\n### `npm run styleguide:build`\nBuilds the styleguide documentation for production. The output targets the `styleguide` folder.\n\n\n## About UNICEF\n\n[UNICEF](https://www.unicef.org/) works in over 190 countries and territories to protect the rights of every child. UNICEF has spent more than 70 years working to improve the lives of children and their families. In UNICEF, we **believe all children have a right to survive, thrive and fulfill their potential – to the benefit of a better world**.\n\n[Donate](https://donate.unicef.org/donate/now)\n\n\n## Collaborations and support\n\nJust fork the project and make a pull request. You may also [consider donating](https://donate.unicef.org/donate/now).\n\n\n## License\n\nCopyright (c) 2019 UNICEF.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\n### Acknowledgements\n\nThe majority of the source code of this repo was developed by [@sureshsevarthi](http://github.com/sureshsevarthi).\n\nAlso, this source code is based on [react-numeric](https://github.com/mkg0/react-numeric).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funicef%2Fmaterial-ui-currency-textfield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funicef%2Fmaterial-ui-currency-textfield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funicef%2Fmaterial-ui-currency-textfield/lists"}