---
title: "invalid-recipe-input"
description: "Reports && or a ternary inside a style.recipe() value."
image: "https://stillwind.dev/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://stillwind.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# invalid-recipe-input

This rule reports a runtime condition, such as `&&` or a ternary, inside the base
or an option value of [`style.recipe()`](https://stillwind.dev/docs/macros/recipe). The compiler generates
every value when it creates the factory, so the condition cannot choose a style.

## Reported

```tsx
declare const active: boolean;
style.recipe(active && "bg-blue-500");
```

> invalid-recipe-input: style.recipe() values require static utilities, arrays, CSS variants, or custom properties; utility inputs cannot use `&&` or ternary expressions
> 
> Example:2:14

## Fixed

```tsx
declare const active: boolean;
const button = style.recipe("", {
  variants: {
    active: {
      true: "bg-blue-500",
      false: null,
    },
  },
});
button({ active });
```

## How to fix

- Turn the condition into an option, and pass the current value when you call the
  factory, as in the example.
- Stored [`style()`](https://stillwind.dev/docs/macros/style) results, refs, animations, and `class`
  fields are not accepted either. Use them in `style()` instead.

See [`style.recipe()`](https://stillwind.dev/docs/macros/recipe#style-values).

## Rule settings

| Preset | Severity |
| --- | --- |
| `recommended` | deny |
| `strict` | deny |
| `stylistic` | off |

[Configure lint](https://stillwind.dev/docs/configuration#lint) to change the severity or options.

Source: https://stillwind.dev/docs/lints/invalid-recipe-input/index.mdx
