# Radio

{% tabs %}
{% tab title="First Tab" %}
![](https://3246461946-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQWt7hBSh108moAc0Al%2F-MgM8Ca24XFFdk3N-PQN%2F-MgM9cdlWiBC9oOMYj6B%2Fradio-img.png?alt=media\&token=7749e1d5-a15a-40de-bd91-43dc02021498)
{% endtab %}

{% tab title="Component" %}
Options can be callable, collection or associative/flat array.

```php
//associative array
$options = ['Wifi' => 'wf', 'Bluetooth' => 'bl', 'Ethernet' => 'eth'];

Radio::make('Radio')
    ->wire('defer') //wait with validation until next request.
    ->options($options)
    ->rules([Rule::in(array_values($options))])
    ->default('wf');
```

```php
//Radio where labels = key
$options = ['Wifi', 'Bluetooth', 'Ethernet'];

Radio::make('Radio')
    ->options($options)
    ->rules([Rule::in($options)])
    ->default('Wifi');
```

{% endtab %}

{% tab title="Headless" %}

```php
//Livewire
public $radio;
public $options = ['Wifi' => 'wf', 'Bluetooth' => 'bl', 'Ethernet' => 'eth'];
```

```markup
<x-tall-radio :field="Radio::blade('radio')
    ->options($options)
    ->default('wf')"
/>
```

{% endtab %}
{% endtabs %}

### ->options($options)

* A list or flat `key => value` based `Array`, `Collection` or `Closure`.
* **OBSERVE**: if you use a callable, it will be executed on EVERY re-render of the component! Maybe you should consider setting the `$options` in `mount(`) instead?
* You can use a component method that returns an array; \
  `->options($this->someMethod())`
