Type key: yes_no. Renders a two-option question whose options always have the values yes and no. In the editor this is the Yes/No block.
A question: the question rules and the option layout and color rules in option rules apply, and it can sit in a layout row column.
Meta fields
Section titled “Meta fields”The meta fields of this node type are listed in the request body of Replace the draft document, under pages › nodes, in the yes_no tab.
Example
Section titled “Example”{ "public_id": "nDnr", "sort_order": 1, "type": "yes_no", "meta": { "question": "<span>Will you join the speakers' dinner?</span>", "select_options_data": [ { "value": "yes", "label": "Yes" }, { "value": "no", "label": "No" } ], "validation": { "required": true } }}Defaults and rules
Section titled “Defaults and rules”select_options_dataalways holds two options with the valuesyesandno, labelled “Yes” and “No” by default. The server normalizes anything else back into that shape, so only the labels are yours to change. There is no “Other” option.select_options_styledefaults toradio;checkboxswaps the control style.default_valueis"yes"or"no".