{"id":23442258,"url":"https://github.com/teamwertarbyte/material-ui-toggle-icon","last_synced_at":"2025-04-13T11:11:12.709Z","repository":{"id":38375478,"uuid":"105325418","full_name":"TeamWertarbyte/material-ui-toggle-icon","owner":"TeamWertarbyte","description":"An animated toggle icon for Material-UI.","archived":false,"fork":false,"pushed_at":"2023-01-06T01:31:46.000Z","size":957,"stargazers_count":35,"open_issues_count":9,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T02:03:36.233Z","etag":null,"topics":["icon","material","material-ui","react","toggle","ui"],"latest_commit_sha":null,"homepage":"https://mui.wertarbyte.com/#material-ui-toggle-icon","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/TeamWertarbyte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["leMaik","saschb2b"]}},"created_at":"2017-09-29T23:32:05.000Z","updated_at":"2024-06-24T07:09:58.000Z","dependencies_parsed_at":"2023-02-05T01:32:25.173Z","dependency_job_id":null,"html_url":"https://github.com/TeamWertarbyte/material-ui-toggle-icon","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeamWertarbyte%2Fmaterial-ui-toggle-icon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeamWertarbyte%2Fmaterial-ui-toggle-icon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeamWertarbyte%2Fmaterial-ui-toggle-icon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeamWertarbyte%2Fmaterial-ui-toggle-icon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TeamWertarbyte","download_url":"https://codeload.github.com/TeamWertarbyte/material-ui-toggle-icon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248703198,"owners_count":21148118,"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":["icon","material","material-ui","react","toggle","ui"],"created_at":"2024-12-23T17:29:05.312Z","updated_at":"2025-04-13T11:11:12.684Z","avatar_url":"https://github.com/TeamWertarbyte.png","language":"JavaScript","readme":"# material-ui-toggle-icon\n\nThis project provides a toggle icon for [Material-UI][mui].\n\n![Demo](demo.gif)\n\nIf you want to try the component yourself instead of watching a gif, head over to [the styleguide][styleguide] for a live demo!\n\n## Installation\n\n```shell\nnpm i --save material-ui-toggle-icon\n```\n\n## Usage\n\nThe component takes two icons and a boolean that tells it whether to display the `onIcon` or the `offIcon`. When `on` is changed, the icon is switched with a transition.\n\n```jsx\nimport ToggleIcon from \"material-ui-toggle-icon\";\nimport IconButton from \"@material-ui/core/IconButton\";\nimport Visibility from \"@material-ui/icons/Visibility\";\nimport VisibilityOff from \"@material-ui/icons/VisibilityOff\";\n\nexport default class ToggleIconButton extends Component {\n  state = { on: false };\n\n  render() {\n    \u003cIconButton onClick={() =\u003e setState((state) =\u003e ({ on: !state.on }))}\u003e\n      \u003cToggleIcon\n        on={state.on}\n        onIcon={\u003cVisibility /\u003e}\n        offIcon={\u003cVisibilityOff /\u003e}\n      /\u003e\n    \u003c/IconButton\u003e;\n  }\n}\n```\n\n## Properties\n\n| Name      | Type      | Default | Description                                                  |\n| --------- | --------- | ------- | ------------------------------------------------------------ |\n| offIcon\\* | `element` |         | The icon to be displayed if the `on` prop is set to `false`. |\n| onIcon\\*  | `element` |         | The icon to be displayed if the `on` prop is set to `true`.  |\n| on\\*      | `bool`    |         | Controls whether the `onIcon` or the `offIcon` is displayed. |\n| style     | `object`  |         | Override the inline-styles of the root element.              |\n\n\\* required property\n\n## License\n\nThe files included in this repository are licensed under the MIT license.\n\n[mui]: http://www.material-ui.com/#/\n[styleguide]: https://mui.wertarbyte.com/#material-ui-toggle-icon\n","funding_links":["https://github.com/sponsors/leMaik","https://github.com/sponsors/saschb2b"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteamwertarbyte%2Fmaterial-ui-toggle-icon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteamwertarbyte%2Fmaterial-ui-toggle-icon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteamwertarbyte%2Fmaterial-ui-toggle-icon/lists"}