# Recipe

> Associates an identifiable theme recipe with its ordered cookbook.

[API reference](/docs/api/index.md) › [HTML Core](/docs/extensions/html-core/reference/index.md) › [Config](/docs/extensions/html-core/reference/config/index.md) › Recipe

| final readonly class | `UIAwesome\Html\Core\Config\Recipe` |
| --- | --- |
| Source | [`src/Config/Recipe.php`](https://github.com/ui-awesome/html-core/blob/main/src/Config/Recipe.php#L18) |

Associates an identifiable theme recipe with its ordered cookbook.

By convention, the recipe name is prefixed with the theme identifier (for example, `flowbite.button`) so error
messages and diagnostics trace the originating theme without extra plumbing.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-cookbook"></span>`$cookbook` readonly constructor | [`Cookbook`](/docs/extensions/html-core/reference/config/cookbook/index.md) | Ordered config calls applied by the recipe. | `Recipe` |
| <span id="property-name"></span>`$name` readonly constructor | `string` | Recipe identifier used to trace which recipe configured a component. | `Recipe` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Creates a named recipe with its cookbook. | `Recipe` |

## Method details

### __construct() <span id="method-__construct"></span>

```php
public function __construct(string $name, UIAwesome\Html\Core\Config\Cookbook $cookbook)
```

Creates a named recipe with its cookbook.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$name` | `string` | Recipe identifier used to trace which recipe configured a component. |
| `$cookbook` | [`Cookbook`](/docs/extensions/html-core/reference/config/cookbook/index.md) | Ordered config calls applied by the recipe. |

**Throws**

- [`InvalidArgumentException`](https://www.php.net/manual/en/class.invalidargumentexception.php): If the recipe name is empty or contains whitespace.