{"id":30105246,"url":"https://github.com/zxqx/react-password-mask","last_synced_at":"2025-08-09T23:51:09.246Z","repository":{"id":57342316,"uuid":"68748701","full_name":"zxqx/react-password-mask","owner":"zxqx","description":"Show/hide the contents of a password field.","archived":false,"fork":false,"pushed_at":"2024-08-21T09:56:33.000Z","size":653,"stargazers_count":34,"open_issues_count":10,"forks_count":21,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-30T14:51:12.908Z","etag":null,"topics":["component","react"],"latest_commit_sha":null,"homepage":"","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/zxqx.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}},"created_at":"2016-09-20T20:01:00.000Z","updated_at":"2025-01-30T03:59:47.000Z","dependencies_parsed_at":"2022-09-16T03:01:51.744Z","dependency_job_id":null,"html_url":"https://github.com/zxqx/react-password-mask","commit_stats":null,"previous_names":["zakangelle/react-password-mask"],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/zxqx/react-password-mask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxqx%2Freact-password-mask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxqx%2Freact-password-mask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxqx%2Freact-password-mask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxqx%2Freact-password-mask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zxqx","download_url":"https://codeload.github.com/zxqx/react-password-mask/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxqx%2Freact-password-mask/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269654644,"owners_count":24454327,"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","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["component","react"],"created_at":"2025-08-09T23:51:08.453Z","updated_at":"2025-08-09T23:51:09.169Z","avatar_url":"https://github.com/zxqx.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Password Mask\n\nShow/hide the contents of a password field.\n\n[![Coverage Status](https://img.shields.io/coveralls/zakangelle/react-password-mask.svg)](https://coveralls.io/github/zakangelle/react-password-mask?branch=master)\n\n\n\u003ca href=\"https://zakang.name/react-password-mask/\"\u003e\n  \u003cimg src=\"https://www.dropbox.com/s/rop6okglcobb8tw/react-password-mask.gif?raw=1\" width=\"350px\" /\u003e\n\u003c/a\u003e\n\n## Installation\n\n```sh\n$ npm install react-password-mask\n```\n\n## Usage\n\n```js\nimport PasswordMask from 'react-password-mask';\n```\n\n```js\n\u003cPasswordMask\n  id=\"password\"\n  name=\"password\"\n  placeholder=\"Enter password\"\n  value={this.state.password}\n  onChange={this.handleChange.bind(this)}\n/\u003e\n```\n\n### Unstyled Example\n\nUse `useVendorStyles={false}` to disable the default CSS styles from the package. You can then style the component from scratch using `inputStyles`/`buttonStyles` or `inputClassName`/`buttonClassName`.\n\n```js\n\u003cPasswordMask\n  id=\"password\"\n  name=\"password\"\n  value={this.state.password}\n  onChange={this.handleChange.bind(this)}\n  useVendorStyles={false}\n/\u003e\n```\n\n## Options\n\n| Option        | Type      | Description                                                   |\n|---------------|-----------|---------------------------------------------------------------|\n| `value`       | any       | The value of the password field.                              |\n| `id`          | string    | The HTML `id` attribute used for the password field.          |\n| `name`        | string    | The HTML `name` attribute used for the password field.        |\n| `className`   | string    | A space-separated list of HTML `class` attributes applied to the container.            |\n| `inputClassName`   | string    | A space-separated list of HTML `class` attributes, applied to the password field.            |\n| `buttonClassName`   | string    | A space-separated list of HTML `class` attributes, applied to the show/hide button.            |\n| `placeholder` | string    | The HTML `placeholder` attribute used for the password field. |\n| `autoFocus` | boolean    | The HTML `autofocus` attribute used for the password field. |\n| `maxLength` | number    | The HTML `maxlength` attribute used for the password field. |\n| `onChange`    | function  | A callback function to be invoked when the `value` of the field changes. Receives an argument containing the React `SyntheticEvent` object. |\n| `onKeyDown`   | function  | A callback function to be invoked when a key is pressed inside the input field. Receives an argument containing the React `SyntheticEvent` object. |\n| `onShow`      | function  | A callback function to be invoked when the `value` of the field is shown. Receives an argument containing the current value of the field. |\n| `onHide`      | function  | A callback function to be invoked when the `value` of the field is masked. Receives an argument containing the current value of the field. |\n| `onToggle`    | function  | A callback function to be invoked when the `value` of the field is shown or masked. Receives an argument containing the current value of the field. |\n| `inputStyles` | object | Inline CSS styles to be applied to the password field.            |\n| `buttonStyles`| object | Inline CSS styles to be applied to the show/hide button.          |\n| `useVendorStyles`| boolean | Whether the vendor styles of this package should be applied at all. Default: `true`          |\n| `showButtonContent` | element, string | The HTML content of the show button. |\n| `hideButtonContent` | element, string | The HTML content of the hide button. |\n\n## Development\n\nInstall dependencies:\n\n```\n$ npm install\n```\n\nRun the example app at [http://localhost:8080](http://localhost:8080):\n\n```\n$ npm run example\n```\n\nRun tests using [jest](https://github.com/facebook/jest):\n\n```\n$ npm test\n```\n\nUpdate test snapshots:\n\n```\n$ npm run test:update\n```\n\nRun tests and watch for code changes:\n\n```\n$ npm run test:watch\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzxqx%2Freact-password-mask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzxqx%2Freact-password-mask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzxqx%2Freact-password-mask/lists"}