This Sandcastle has an example of toggle buttons:
https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Shadows.html
Note that this works in Sandcastle, because of the additional helper functions there, but wouldn’t work in a web app that just includes the CesiumJS library.