> ## 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.

# Installation

> Install TUI Pantry and scaffold a component preview for your ratatui widget crate.

## Prerequisites

* Rust toolchain (stable)
* A crate with [ratatui](https://ratatui.rs) widgets

## Install

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
cargo install tui-pantry
```

This adds the `cargo pantry` subcommand to your toolchain.

## Initialize

From your widget crate root:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
cargo pantry init
```

This does four things:

1. Adds `tui-pantry` as an optional dependency (`cargo add tui-pantry --optional`)
2. Creates `pantry.toml` with default config
3. Scaffolds `examples/widget_preview/` with sample **Widgets**, **Panes**, and **Views** ingredients
4. Prints next steps for wiring your own widgets

The scaffold compiles and runs immediately. No additional setup required.

## Launch

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
cargo pantry
```

You should see the Pantry open with sample ingredients across three tabs. Navigate with `j`/`k` or arrow keys, switch tabs with `1` to `4`, and press `q` to quit.

<img src="https://mintcdn.com/taho/hwybq0rCf17YoXDw/tui-pantry/images/widgets.png?fit=max&auto=format&n=hwybq0rCf17YoXDw&q=85&s=06126df3475f1b943fdb4b5a8236621e" alt="TUI Pantry Widgets tab" width="1280" height="720" data-path="tui-pantry/images/widgets.png" />

From here, explore the sample ingredients, then replace them with previews of your own widgets. See [Writing Ingredients](/tui-pantry/writing-ingredients) for how to define them.

## Workspace usage

In a multi-crate workspace, target a specific package:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
cargo pantry -p my-widget-crate
```
