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

# Configuration

> Reference for pantry.toml. Theme, colors, typography, and ingredient registration.

The Pantry is configured through a single `pantry.toml` file at your widget crate root.

## Full example

```toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[config]
theme = "light"
style_source = "my_crate::styles"

[colors.brand]
deep_purple = "#2E1574"
white = "#FFFFFF"

[colors.green]
100 = "#DCFCE7"
500 = "#22C55E"
900 = "#14532D"

[typography]
text = { color = "#FFFFFF", description = "Primary content" }
text_dim = { color = "DarkGray", description = "Secondary labels" }

[ingredients]
source = "my_crate"
modules = ["widgets::gauge", "widgets::table"]
```

## `[config]`

| Key            | Default  | Description                                                                                              |
| -------------- | -------- | -------------------------------------------------------------------------------------------------------- |
| `theme`        | `"dark"` | Chrome palette: `"dark"` (Catppuccin Mocha) or `"light"` (Catppuccin Latte). Toggle at runtime with `t`. |
| `style_source` | none     | Module path prefix for auto-generated Styles tab ingredients (e.g., `"my_crate::styles"`).               |

## `[colors.*]`

Each `[colors.<family>]` table becomes a group in the Styles tab. Two key formats are supported:

**Named keys** (snake\_case) render as individual swatches with a colored block, display name, and hex value:

```toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[colors.brand]
deep_purple = "#2E1574"
white = "#FFFFFF"
```

<img src="https://mintcdn.com/taho/hwybq0rCf17YoXDw/tui-pantry/images/palette.png?fit=max&auto=format&n=hwybq0rCf17YoXDw&q=85&s=1974890efaceac15a8a3caff5256ccae" alt="Named color swatches" width="1069" height="446" data-path="tui-pantry/images/palette.png" />

**Numeric keys** render as a horizontal scale strip showing the gradient across values:

```toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[colors.green]
100 = "#DCFCE7"
500 = "#22C55E"
900 = "#14532D"
```

<img src="https://mintcdn.com/taho/hwybq0rCf17YoXDw/tui-pantry/images/swatch.png?fit=max&auto=format&n=hwybq0rCf17YoXDw&q=85&s=3351ae6d73210df6c444aa953e743cf1" alt="Scale strip rendering" width="1077" height="114" data-path="tui-pantry/images/swatch.png" />

## `[typography]`

Each key renders sample text in its specified color with the description alongside. Color values accept hex (`"#FFFFFF"`) or named ratatui colors (`"DarkGray"`).

```toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[typography]
text = { color = "#FFFFFF", description = "Primary content" }
text_dim = { color = "DarkGray", description = "Secondary labels" }
```

Colors and typography entries auto-generate into the **Styles** tab with no ingredient code required. The `style_source` value from `[config]` sets the breadcrumb module path for these generated ingredients.

## `[ingredients]`

Declares ingredient modules for compile-time discovery via the `pantry_ingredients!()` proc macro.

| Key       | Description                                                                            |
| --------- | -------------------------------------------------------------------------------------- |
| `source`  | Crate name used as the module path prefix.                                             |
| `modules` | List of module paths. Each expands to `{source}::{module}::ingredient::ingredients()`. |

```toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[ingredients]
source = "my_crate"
modules = [
    "widgets::gauge",
    "widgets::node_table",
]
```

For aggregating ingredients from multiple crates, use array-of-tables syntax:

```toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[[ingredients]]
source = "crate_a"
modules = ["widgets::foo"]

[[ingredients]]
source = "crate_b"
modules = ["widgets::bar"]
```

The `[ingredients]` section is only needed when using the proc macro. For manual aggregation, omit it and pass ingredients directly to `tui_pantry::run!()`. See [Writing Ingredients](/tui-pantry/writing-ingredients#registration) for details.
