{"id":18260731,"url":"https://github.com/ferndot/jquery.nice-number","last_synced_at":"2025-04-04T20:30:25.846Z","repository":{"id":37892869,"uuid":"111279213","full_name":"ferndot/jquery.nice-number","owner":"ferndot","description":"A tiny jQuery plugin for styling HTML number inputs","archived":false,"fork":false,"pushed_at":"2023-07-12T14:53:36.000Z","size":568,"stargazers_count":8,"open_issues_count":5,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T01:35:17.541Z","etag":null,"topics":["css3","html-inputs","html5","html5-input","html5-inputs","jquery","jquery-plugin","number-input","number-spinner","spinner"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/jquery.nice-number","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ferndot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-11-19T08:54:11.000Z","updated_at":"2022-06-14T22:27:54.000Z","dependencies_parsed_at":"2024-06-21T13:25:07.908Z","dependency_job_id":"1d8cf442-f582-45b0-95ac-6ab1f82ee225","html_url":"https://github.com/ferndot/jquery.nice-number","commit_stats":null,"previous_names":["joshua-s/jquery.nice-number"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferndot%2Fjquery.nice-number","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferndot%2Fjquery.nice-number/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferndot%2Fjquery.nice-number/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferndot%2Fjquery.nice-number/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ferndot","download_url":"https://codeload.github.com/ferndot/jquery.nice-number/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247245981,"owners_count":20907719,"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":["css3","html-inputs","html5","html5-input","html5-inputs","jquery","jquery-plugin","number-input","number-spinner","spinner"],"created_at":"2024-11-05T10:48:45.220Z","updated_at":"2025-04-04T20:30:25.412Z","avatar_url":"https://github.com/ferndot.png","language":"JavaScript","readme":"# jQuery Nice Number\n\nA tiny plugin that converts HTML numeric inputs (`type=\"number\"`) into an\neasily-styled format.\n\n## Usage\n\n### Prerequisites\n\nDownload the project files or install it using Yarn, NPM, etc...\n\n```sh\n$ yarn add jquery.nice-number\n$ npm install jquery.nice-number --save\n```\n\nInclude the plugin files in your source.\n\n\u003e Note: the path will need to be changed if you downloaded or moved the files.\n\n```html\n\u003clink\n\trel=\"stylesheet\"\n\thref=\"node_modules/jquery.nice-number/dist/jquery.nice-number.min.css\"\n/\u003e\n\u003cscript src=\"node_modules/jquery.nice-number/dist/jquery.nice-number.min.js\"\u003e\u003c/script\u003e\n```\n\n### Basic usage\n\nCall the `niceNumber()` function on your jQuery element of choice.\n\n\u003e Pro Tip: use `$('input[type=\"number\"]')` to select all numeric inputs in the\n\u003e current page.\n\n```javascript\n$('input[type=\"number\"]').niceNumber();\n```\n\n### Advanced usage\n\nYou can pass an optional object to `niceNumber()` containing advanced\nconfiguration options.\n\n#### Currently supported options\n\n| Name            | Permitted values                                           | Description                                                                                                             | Default value |\n| --------------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------- |\n| autoSize        | boolean                                                    | Enables or disables automatic input sizing to fit content                                                               | `true`        |\n| autoSizeBuffer  | number                                                     | The number of extra character widths that are added to the element's content size calculation when automatically sizing | `1`           |\n| buttonDecrement | jQuery element, HTML element, HTML string, or plain string | The contents of the decrement button                                                                                    | `'-'`         |\n| buttonIncrement | jQuery element, HTML element, HTML string, or plain string | The contents of the increment button                                                                                    | `'+'`         |\n| buttonPosition  | `'around'`, `'left'`, or `'right'`                         | The positions of the control buttons                                                                                    | `'around'`    |\n| onDecrement     | false or function                                          | callback function to run on decrement                                                                                   | false         |\n| onIncrement     | false or function                                          | callback function to run on increment                                                                                   | false         |\n\n**Callback Examples**\n\nPassed arguments are `$currentInput`: the selected input in a jQuery object, the new amount, and the niceNumber settings.\n\n```js\n$('input[type=\"number\"]').niceNumber({\n\tonIncrement: function ($currentInput, amount, settings) {\n\t\tif (amount \u003e= 100) {\n\t\t\t$currentInput.classList.add('more-than-100');\n\t\t} else {\n\t\t\t$currentInput.classList.remove('more-than-100');\n\t\t}\n\t},\n});\n```\n\n## Development\n\n### Building\n\nInstall the project dependencies\n\n```sh\n$ yarn\n```\n\nBuild the project\n\n```sh\n$ yarn gulp\n```\n\nOr individually\n\n```sh\n$ yarn gulp css\n\n$ yarn gulp js\n\n$ yarn gulp copy # copies the contents of the src folder to the dist folder\n```\n\nIf you are developing on the project, you can use\n\n```sh\n$ yarn gulp dev # runs default, then copy, css, js on save of any src file\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferndot%2Fjquery.nice-number","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fferndot%2Fjquery.nice-number","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferndot%2Fjquery.nice-number/lists"}