TigriWeb Components
AttributesControlsMetaPrimitivesIntegrations
  • Table of Contents
  • Attributes
    • Checkbox
    • Color
    • ColorGradient
    • DateTime
    • Icon
    • Media
    • Number
    • PostType
    • PostTypeMultiple
    • Radio
    • Range
    • Select
    • Taxonomy
    • TaxonomyMultiple
    • Text
    • Textarea
    • Toggle
    • ToolbarButton
    • ToolbarGroup
  • Controls
    • AppenderButton
    • Media
    • RichHeading
    • RichText
  • Meta
    • Checkbox
    • Color
    • DateTime
    • Icon
    • Media
    • Number
    • PostType
    • PostTypeMultiple
    • Radio
    • Range
    • Select
    • Taxonomy
    • TaxonomyMultiple
    • Text
    • Textarea
    • Toggle
  • Primitives
    • HTML
    • SVG
  • Integrations
    • Enqueue SVG icons
    • Enqueue I18n strings
Powered by GitBook
On this page

Was this helpful?

  1. Attributes

Radio

PreviousPostTypeMultipleNextRange

Last updated 6 months ago

Was this helpful?

{ label, help, choices*, name*, attributes*, setAttributes* }
/**
 * @param {string} [label] - Component label.
 * @param {string} [help] - Component description.
 * @param {object} choices - Object containing key-value pairs options.
 * @param {string} name - Attribute name.
 * @param {object} attributes - Object containing block attributes.
 * @param {function} setAttributes - Function to set new block attribute values.
 */
block.json
"testRadio": {
	"type": "string",
	"default": "choice1"
}
index.js
import {
	TwebBlockRadioControl,
} from '@tigriweb/components/attributes';
index.js | edit()
<TwebBlockRadioControl
	label={ __('Radio Label', 'your-theme-name') }
	help={ __('Radio Description', 'your-theme-name') }
	choices={ {
		'choice1': __('Choise 1', 'your-theme-name'),
		'choice2': __('Choise 2', 'your-theme-name'),
		'choice3': __('Choise 3', 'your-theme-name'),
	} }
	name="testRadio"
	{ ...{ attributes, setAttributes } }
/>
TwebBlockRadioControl