Skip to main content

Introduction

The radio input provides a radio button group for selecting a single value from a list of predefined options:

Setting option descriptions

You can optionally provide descriptions to each option using the descriptions() method:
Be sure to use the same key in the descriptions array as the key in the option array so the right description matches the right option.

Positioning the options inline with each other

You may wish to display the options inline() with each other:
Optionally, you may pass a boolean value to control if the options should be inline or not:

Disabling specific options

You can disable specific options using the disableOptionWhen() method. It accepts a closure, in which you can check if the option with a specific $value should be disabled:
If you want to retrieve the options that have not been disabled, e.g. for validation purposes, you can do so using getEnabledOptions():
For more information about the in() function, please see the Validation documentation.

Boolean options

If you want a simple boolean radio button group, with β€œYes” and β€œNo” options, you can use the boolean() method:
To customize the β€œYes” label, you can use the trueLabel argument on the boolean() method:
To customize the β€œNo” label, you can use the falseLabel argument on the boolean() method: