I happen to be working on the same thing this weekend. Here is the relevant documentation that has most of what you need to get up and running. I’m using a ToggleControl but it is very similar to using a CheckboxControl. I’ll paste code below but you will also find this extensive tutorial to be very helpful.
Define your toggle:
//Gutenburg toggle
let GutenbergToggle = (props) => {
return (
<ToggleControl
label="Some Toggle Control"
checked={ props.state }
onChange={(value) => props.onBlockEditorToggleChange(value)}
/>
)
}
Then add it to the panel:
const PluginPostStatusInfoTest = () => (
<PluginPostStatusInfo>
<p>Post Status Info SlotFill</p>
<GutenbergToggle />
</PluginPostStatusInfo>
);
Rudimentary code to save and retrieve the data:
GutenbergToggle = withSelect(
(select) => {
return {
state: select('core/editor').getEditedPostAttribute('meta')['_use_block_editor']
}
}
)(GutenbergToggle);
GutenbergToggle = withDispatch(
(dispatch) => {
return {
onBlockEditorToggleChange: (value) => {
dispatch('core/editor').editPost({ meta: { _use_block_editor: value } });
}
}
}
)(GutenbergToggle);