# Inline Menu

## What is an inline menu?

An **inline menu** is a card-based search interface that opens directly within Telegram when a user types **@your_bot_name** in any chat. A pop-up list of results appears, allowing the user to scroll through and make a selection.

This feature is ideal for product catalogs, content libraries, directories, and any other structured lists that users might want to search.

> This feature works only if inline mode is enabled in the bot's settings via **@BotFather** (using the /setinline command).

## Data sources

The inline menu supports three data sources:

### Manual mode

Cards are defined manually in the editor. For each card, you specify:
- **Title** — the main text of the card
- **Description** — details displayed below the title
- **Image** — a thumbnail (URL or file)
- **Selection text** — the message the bot sends to the chat when the card is clicked

Use manual mode for small, static lists, such as FAQs, service lists, or subscription types.

### Dynamic mode: Product catalog

Cards are generated from your bot's product catalog. Search is performed in real-time based on product names. Each card displays the product's name, description, and image.

Use this mode for online stores and storefronts.

### Dynamic mode: File library

Cards are generated from the bot's [file library](File%20Library.md). You can filter results by file type (photo, video, audio, document).

Use this mode for media libraries, image collections, or audio libraries.

## Pagination

If there are many results, the inline menu automatically paginates them; the user scrolls through the list and loads the next batch of results.

## Interactive selection (via-bot)

When a user clicks an inline menu card in a chat, the selected item's data can be automatically saved to variables, triggering a specific scenario. ### How to set it up

1. In the inline menu settings, enable **"Run command after selection"**.
2. Select the **target node** — the place the bot will navigate to after the selection is made.
3. Specify the **variable** — where the selected item's data (ID, name, etc.) will be stored.

### What happens upon selection

The user selects a card → the bot triggers the specified node in the private chat with the user → the selected item's payload is saved to the variable.

You can then use the item's data in any of the node's blocks: to display a description, show the price, create an invoice, etc.

## Tips

- For catalog searches, choose the **dynamic mode based on products** — it stays up-to-date automatically and requires no manual updates.
- The "via-bot" feature is perfect for selecting a product before payment: the user searches for the desired item → selects it → the bot automatically generates an invoice.
- Cards with images attract more attention — try to fill in the photo field.