A radio input component.

Parameters:
NameTypeDescription
propsobject

Component props.

Properties
NameTypeDescription
childrenJSX.Element

React element children.

customAttributesobject

Custom attributes for the component.

customClassesstring | Array | object

Custom classes for the component.

disabledboolean

If radio is disabled.

externalCheckedboolean

If radio is checked or not, can change current checked state if changed.

externalControlboolean

If radio can be controlled externally.

helpTextAttributesobject

Custom attribute for the help text.

idstring

Optional id. Auto generated if not passed.

initialCheckedboolean

Is it checked on render?

labelAttributesobject

Any custom attributes for the label.

namestring

The name attribute for the radio.

onBlurfunction

On blur function handler.

onChangefunction

On change function handler.

onFocusfunction

On focus function handler.

sizestring

The radio size: small (size-sm) or medium (size-md).

spacingstring | number | Array | object

The spacing for the component, as a string, number, array, or object.

themestring

The theme of the radio.

typestring

The radio type. 'standard' or 'image'.

valuestring

The radio value.

wrapperAttributesobject

Custom attributes for the wrapper element.

wrapperClassesstring | Array | object

Custom classes for the wrapper element.

wrapperTagNameobject

Tag to use for the radio wrapper. Defaults to div.

refobject | null

Ref to the component.

Since
  • 1.1.15
Returns:

The radio component.

Type: 
JSX.Element
Example
import Radio from '@gravityforms/components/react/admin/elements/Radio';

return <Radio id="radio-id" name="radio-name" onChange={ () => {} } value="radio-value" />;