---
title: "Radio"
description: "The Radio control offers a set of options and the editor picks one. Output Format sets whether the block gets the value, the label or both as an array."
url: "https://www.lazyblocks.com/docs/blocks-controls/radio/"
lastUpdated: 2026-09-23
source: "blocks-controls/radio.mdx"
---
# Radio

Radio control lets you add a set of options where users can select one choice. Each option can have a label for display and a value for storing.

## Control Settings

- **Choices** (`choices`) - a `Label` and a `Value` for each option, added with **+ Add Choice**. Empty by default
- **Allow Null** (`allow_null`) - off by default. On, a required Radio accepts an empty value. It adds no clear option to the buttons themselves, unlike [Select](https://www.lazyblocks.com/docs/blocks-controls/select/), which gains a `-- Select --` entry
- **Output Format** (`output_format`) - `Value` by default:
  - `Value` - Returns option value
  - `Label` - Returns option label
  - `Both (Array)` - Returns both value and label

To add options, fill the Choices setting:

## Usage

### Basic Usage

```php title="PHP" /$attributes['control_name']/
<div class="option">
  <?php echo esc_html( $attributes['control_name'] ); ?>
</div>
```

```hbs title="Handlebars" /{{control_name}}/
<div class="option">
  {{control_name}}
</div>
```

### With Array Output Format

```php title="PHP" /$attributes['control_name']/
<?php if ( $attributes['control_name'] ) : ?>
  <div class="option">
    <span class="label"><?php echo esc_html( $attributes['control_name']['label'] ); ?></span>
    <span class="value"><?php echo esc_html( $attributes['control_name']['value'] ); ?></span>
  </div>
<?php endif; ?>
```

```hbs title="Handlebars" /control_name/
<div class="option">
  <span class="label">{{control_name.label}}</span>
  <span class="value">{{control_name.value}}</span>
</div>
```

### Post Meta

```php title="Post Meta" /get_lzb_meta( 'control_meta_name' )/
<div class="option">
  <?php echo esc_html( get_lzb_meta( 'control_meta_name' ) ); ?>
</div>
```

Use meaningful values in your choices that can be used as CSS classes or for conditional logic.

## Documentation Index
> Fetch the complete documentation index at: https://www.lazyblocks.com/llms.txt
> Fetch every page in a single file at: https://www.lazyblocks.com/llms-full.txt
