From the contributor
How to use this sample
Summary
This sample demonstrates changing the value of the Yes/No column to a toggle. Three different versions of the sample are provided (Toggle, Icon, & Emoji). Also, this sample uses the setValue of customRowAction to update the field. You need to set the actionInput to the internal name of the column to be updated.

View requirements
This format can be applied to a Yes/No column.
Sample
| Solution | Author(s) |
|---|---|
| yesno-toggle-format.json | Tetsuya Kawahara |
| yesno-toggle-icon-format.json | Tetsuya Kawahara |
| yesno-toggle-emoji-format.json | Tetsuya Kawahara |
Version history
| Version | Date | Comments |
|---|---|---|
| 1.0 | April 29, 2021 | Initial release |
| 1.1 | November 21, 2021 | Modified to update item using setValue |
Disclaimer
THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
Additional notes
There is also a way to implement this with SPFx Extension, available from PnP: React Toggle Field Customizer