# TubingGui

{% hint style="warning" %}
It is recommended to use Tubing Gui templates instead of using the builder described here
{% endhint %}

A Tubing Gui is a class which represent an inventory with items + actions to execute upon click.\
To show a TubingGui to a player, it must be returned from a GuiAction inside a [GuiController](https://staffplusplus-minecraft.gitbook.io/tubing/tubing-guis/gui-controllers)

### Builder

TubingGui has builder which we can use to easily build a GUI.

Example:

```java
TubingGui.Builder builder = new TubingGui
    .Builder("Reports HUB", 9)
    .addItem("manage-reports/view/open", 1, openReportsGuiItemStack)
    .addItem("manage-reports/view/my-assigned", 2, myAssignedReportsGuiItemStack)
    .build();
```

AddItem is one example method. It takes a GuiAction identifier as first parameter, the itemstack location in the inventory as second parameter and the exact itemstack as third parameter.

When showing this GUI we will see an inventory, of size 9, with title "Reports HUB" and slot 1 and 2 filled with an itemstack. When clicking on the itemstack the corresponding GuiAction will be triggered.&#x20;
