{"id":15715835,"url":"https://github.com/marchaos/toggle-switch","last_synced_at":"2025-05-12T22:14:05.471Z","repository":{"id":6141644,"uuid":"7370469","full_name":"marchaos/toggle-switch","owner":"marchaos","description":"Mobile inspired toggle switch for modern browsers","archived":false,"fork":false,"pushed_at":"2015-12-21T08:53:26.000Z","size":72,"stargazers_count":13,"open_issues_count":1,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-02T13:50:22.215Z","etag":null,"topics":["apple","control","javascript","switch","toggle"],"latest_commit_sha":null,"homepage":null,"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/marchaos.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":"2012-12-29T21:08:25.000Z","updated_at":"2020-06-12T15:22:52.000Z","dependencies_parsed_at":"2022-09-07T15:22:11.959Z","dependency_job_id":null,"html_url":"https://github.com/marchaos/toggle-switch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchaos%2Ftoggle-switch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchaos%2Ftoggle-switch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchaos%2Ftoggle-switch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchaos%2Ftoggle-switch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marchaos","download_url":"https://codeload.github.com/marchaos/toggle-switch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223835370,"owners_count":17211158,"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":["apple","control","javascript","switch","toggle"],"created_at":"2024-10-03T21:43:11.417Z","updated_at":"2024-11-09T14:04:08.767Z","avatar_url":"https://github.com/marchaos.png","language":"JavaScript","readme":"# Toggle Switch\n\nA lightweight, zero dependency, toggle switch for modern browsers. Inspired by mobile toggle switches.\n\n* 2.5kB compressed JavaScript, 1kB compressed CSS\n* Supports mobile devices (swipe and click)\n* Supports desktop (drag and click)\n\nSee http://marchaos.github.com/toggle-switch for a demo. \n\n# Embedding\n\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003clink rel=\"stylesheet\" href=\"toggleswitch.min.css\" /\u003e\n    \u003cscript src=\"ToggleSwitch.min.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cinput class=\"small blue\" id=\"cb\" type=\"checkbox\" /\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n# JavaScript API\n\n```javascript\nvar switch = new ToggleSwitch(document.getElementById('cb'), 'ON', 'OFF');\n// switch on\nswitch.on();\n// switch off\nswitch.off();\n// toggle on\nswitch.toggle();\n// switch disable\nswitch.disable();\n// switch enable\nswitch.enable();\nalert(\"Switch is \" + ((switch.isOn()) ? \"on\" : \"off\") + \"!\");\nalert(\"Switch is \" + ((switch.isDisabled()) ? \"disabled\" : \"enabled\") + \"!\");\n```\n\n#Kudos\n\n[Chris Brimmel's IOS 5 toggle switch images](http://dribbble.com/shots/216058-iOS-5-Toggle-Switches-iPhone-Retina)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarchaos%2Ftoggle-switch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarchaos%2Ftoggle-switch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarchaos%2Ftoggle-switch/lists"}