I am using switchery js as button in my html page but when i am loading the page i can see the checkbox changing to button. It does not seems pretty good in UI. I think the issue is because of js processing delay as my project has many js files.
I think maybe you can use slideon, which is a similar component built for zero latency and is very lightweight with easy customization options.
Here is the git repo - https://github.com/shaheenhyderk/slideon
And documentaion- https://shaheenhyder.com/slideon
Hope this will solve the issue.