# MenuBuilder
> Abstract base class for building menu layouts with row-based slot configuration.
`gg.lode.bookshelfapi.api.menu.build.MenuBuilder`
---
## Signature
```java
public abstract class MenuBuilder
```
---
## Methods
| Method | Return Type | Description |
|--------|-------------|-------------|
| `buildRow(int index, Consumer<RowBuilder> consumer)` | `MenuBuilder` | Builds a row at the specified index using a [[RowBuilder]]. |
| `set(int row, int col, ItemStack item, Consumer<InventoryClickEvent> event)` | `MenuBuilder` | Sets an item with a click handler at a specific row and column. |
| `getRowBuilders()` | `Map` | Returns the internal map of row builders. |
### Parameters
| Parameter | Type | Description |
|-----------|------|-------------|
| `index` / `row` | `int` | The row index (0-based). |
| `col` | `int` | The column index (0-8). |
| `consumer` | `Consumer<RowBuilder>` | Consumer for configuring the row. |
| `item` | `ItemStack` | The item to place. |
| `event` | `Consumer<InventoryClickEvent>` | Click event handler. |
---
## Usage
```java
// Typically used via TopMenuBuilder
builder.set(1, 4, new ItemStack(Material.DIAMOND), event -> {
event.getWhoClicked().sendMessage("Clicked!");
});
```
---
## Related Pages
- [[TopMenuBuilder]]
- [[RowBuilder]]
- [[Menu]]