Skip to content
This repository has been archived by the owner on Feb 10, 2020. It is now read-only.

Latest commit

 

History

History
64 lines (46 loc) · 1.12 KB

radio.md

File metadata and controls

64 lines (46 loc) · 1.12 KB

radio

image

label:

If set, a label will be generated using label property as the content.

  • Type: String
  • Required: No

help:

Used to add help text below the field.

  • Type: String
  • Required: No

selected:

The value property of the currently selected option.

  • Type: Object
  • Required: No

options:

An array of objects containing the following properties:

  • label: (string) The label to be shown to the user.

  • value: (Object) The internal value compared against select and passed to onChange.

  • Type: Array

  • Required: No

For more read gutenberg readme.

Example:

radio: {
	type: 'string',
	field: {
		type: 'radio',
		label: 'User type',
		help: 'The type of the current user',
		options: [
			{
				value: 'one',
				label: 'Option One',
			},
			{
				value: 'two',
				label: 'Option Two',
			},
		],
	},
	default: 'one',
}

Return

This will return selected value.

  • Type: string