> For the complete documentation index, see [llms.txt](https://docs.hivepress.io/developer-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hivepress.io/developer-docs/framework/fields/checkbox.md).

# Checkbox

This field type renders a checkbox.

### Parameters

* **caption** - text displayed next to the checkbox;
* **check\_value** - value considered as "checked" (`true` by default).

### Example

The code below renders a required checkbox field with the `custom_field` name, "Custom field" label and "Custom text" caption.

```php
echo ( new HivePress\Fields\Checkbox(
	[
		'name'     => 'custom_field',
		'label'    => 'Custom field',
		'caption'  => 'Custom text',
		'required' => true,
	]
) )->render();
```
