Contao Summit 2026 in Leipzig 15th and 16th October

Radio

This widget renders a radio button selection.

Radio buttons Radio buttons

Options

This table only shows the options relevant to the core functionality of this widget. See the DCA reference for a full field reference.

KeyValueDescription
inputTypeselect
optionsarrayAn options array (use in combination with eval.multiple)
options_callbackfunction|callableA callback function that returns the options callback or an array (use in combination with eval.multiple). You may define an anonymous function, but you should consider registering them via service tagging.
referencearrayReference an array that will be used to translate the options. Contao will automatically match the options and reference array by key.
foreignKeystringReference another table to generate options from.
eval.includeBlankOptionboolIncludes a blank option (useful in conjunction with mandatory fields)
eval.blankOptionLabelstring (default -)The label of the blank option
eval.disabledboolDisables the input field

Examples

If you simply want to select an option from a fixed set.

// …
'example' => [
    'label' => ['Example', 'Example radio buttons.'],
    'inputType' => 'radio',
    'options' => [
        'lorem' => 'Lorem',
        'ipsum' => 'Ipsum',
        'dolor' => 'Dolor',
    ],
    'sql' => [
        'type' => 'string',
        'length' => 8, // Must be large enough to store all possible values
        'default' => 'lorem',
    ],
],
// …

You can generate an options array from another table with the foreignKey property.

// …
'example' => [
    'label' => ['Example', 'Example radio buttons.'],
    'inputType' => 'radio',
    'foreignKey' => 'tl_user.name', // Will use `name` as label, and the user `id` as value
    'sql' => [
        'type' => 'integer',
        'unsigned' => true,
        'default' => 0,
    ],
],
// …