{"id":32780453,"url":"https://github.com/rafalmeida73/heart-switch-react-native","last_synced_at":"2025-11-04T18:02:20.906Z","repository":{"id":318712155,"uuid":"1073747472","full_name":"rafalmeida73/heart-switch-react-native","owner":"rafalmeida73","description":"A heart-shaped toggle switch component for React Native","archived":false,"fork":false,"pushed_at":"2025-10-15T20:06:26.000Z","size":3872,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-18T07:12:37.840Z","etag":null,"topics":["component","expo","javascript","react-component","react-native","switch","toggle","toggle-switch","typescript"],"latest_commit_sha":null,"homepage":"https://snack.expo.dev/@rafalmeida73/heart-switch-react-native","language":"TypeScript","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/rafalmeida73.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-10T14:59:43.000Z","updated_at":"2025-10-16T12:12:09.000Z","dependencies_parsed_at":"2025-10-10T18:04:28.151Z","dependency_job_id":"eb76bd13-9cdc-4e38-998c-7c4a1b997b13","html_url":"https://github.com/rafalmeida73/heart-switch-react-native","commit_stats":null,"previous_names":["rafalmeida73/heart-switch-react-native"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rafalmeida73/heart-switch-react-native","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalmeida73%2Fheart-switch-react-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalmeida73%2Fheart-switch-react-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalmeida73%2Fheart-switch-react-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalmeida73%2Fheart-switch-react-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafalmeida73","download_url":"https://codeload.github.com/rafalmeida73/heart-switch-react-native/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafalmeida73%2Fheart-switch-react-native/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":282686005,"owners_count":26710245,"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-11-04T02:00:05.887Z","response_time":62,"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","expo","javascript","react-component","react-native","switch","toggle","toggle-switch","typescript"],"created_at":"2025-11-04T18:01:20.645Z","updated_at":"2025-11-04T18:02:20.901Z","avatar_url":"https://github.com/rafalmeida73.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://www.rafaelsantana.dev/img/heartSwitch/ios.gif\" alt=\"heart-switch Demo\"\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n\u003ch1 align=\"center\"\u003eheart-switch-react-native\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003eA heart-shaped toggle switch component for React Native. Inspired by  \u003ca href=\"https://github.com/anatoliygatt/heart-switch\"\u003eheart-switch\u003c/a\u003e\n\n\u003cbr\u003e\n\n## 🚀 Getting Started\n\n### ⚡️ Quick Start\n\n```shell\nnpm install heart-switch-react-native react-native-reanimated react-native-svg react-native-worklets\n```\n\n```jsx\nimport { useState } from 'react';\nimport { HeartSwitch } from 'heart-switch-react-native';\n\nfunction Example() {\n  const [checked, setChecked] = useState(false);\n\n  return (\n    \u003cHeartSwitch\n      size=\"md\"\n      checked={checked}\n      onChange={(event) =\u003e {\n        setChecked(event);\n      }}\n    /\u003e\n  );\n}\n```\n\n### 💻 Live Demo\n\nhttps://snack.expo.dev/@rafalmeida73/heart-switch-react-native\n\n## ⚙️ Configuration\n\n`HeartSwitch` supports the following props:\n\n| Prop                | Type                  | Default value | Description                                                                                           |\n| ------------------- | --------------------- | ------------- | ----------------------------------------------------------------------------------------------------- |\n| size                | string                | `md`          | The size of the toggle switch. Available sizes: `sm`, `md`, `lg`                                      |\n| checked             | boolean               | `false`       | Controls whether the switch is in the \"on\" (true) or \"off\" (false) state                              |\n| onChange            | function              | -             | Callback function called when the switch state changes. Receives the new boolean state as a parameter |\n| duration            | number                | `300`         | Duration of the animation in milliseconds when the switch toggles                                     |\n| disabled            | boolean               | `false`       | When true, prevents user interaction and applies disabled styling                                     |\n| circleColor         | string                | `#f0f0f0`     | Color of the circular toggle element that moves within the switch                                     |\n| fillColor           | string                | `#ff708f`     | Background fill color of the heart when active (checked=true)                                         |\n| strokeColor         | string                | `#ff4e74`     | Border/stroke color of the heart when active (checked=true)                                           |\n| inactiveFillColor   | string                | `#dcdada`     | Background fill color of the heart when inactive (checked=false)                                      |\n| inactiveStrokeColor | string                | `#b0adad`     | Border/stroke color of the heart when inactive (checked=false)                                        |\n| disabledCircleColor | string                | `#f4f4f4`     | Color of the circle when the switch is disabled                                                       |\n| disabledFillColor   | string                | `#e1e1e1`     | Background fill color when disabled                                                                   |\n| disabledStrokeColor | string                | `#c8c8c8`     | Border/stroke color when disabled                                                                     |\n| initialAnimation    | boolean               | `false`       | When true, enables animation on initial render or when checked prop changes programmatically          |\n| containerProps      | ViewProps             | -             | Additional props to pass to the container View component                                              |\n| buttonProps         | TouchableOpacityProps | -             | Additional props to pass to the TouchableOpacity button component                                     |\n| circleProps         | ViewProps             | -             | Additional props to pass to the circle View component                                                 |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafalmeida73%2Fheart-switch-react-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafalmeida73%2Fheart-switch-react-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafalmeida73%2Fheart-switch-react-native/lists"}