Radio Group

This is a field of radio inputs. Returns the value of your selected option. This field also has the option to be displayed vertically or horizontally, or as radios or buttons.

Radio Group Field
{
  component: 'radio-group',
  name: 'radioName',
  label: 'Radio Group Field',
  description: 'A radio field',
  options: [
    {
      label: 'Yes',
      value: 'yesValue'
    },
    {
      label: 'Maybe',
      value: 'maybeValue'
    },
    {
      label: 'No',
      value: 'noValue'
    },
  ],
  defaultValue: 'maybeValue',
}

Key

Type

Required

Description

component

string

yes

The name of the field component. (radio-group)

name

string

yes

The name of the field that will be accessible by the cms prop of the component.

label

string

no

A human-readable label for the field.

description

no

no

A short description of the setting scope.

options

Array<Option>

no

An array of objects your radio options. The object has a label key and value key.

defaultValue

string

no

This will be a value of your radio values.

variant

"radio" | "button"

no

Will display your radio group as a button or radio input.

direction

"horizontal" | "vertical"

no

Tells buttons to stack vertically or horizontally.

Last updated