# IUIManager
> Manages client-side UI elements: toasts, scrollable text screens, and config/settings screens.
`gg.lode.lecternapi.api.manager.IUIManager`
---
## Signature
```java
public interface IUIManager
```
---
## Methods
### showToast
```java
void showToast(Player player, Toast toast)
void showToast(Player player, String title, String message)
```
Displays a toast notification on the player's client.
This is fire-and-forget; no response is sent back.
Displays a simple info toast with the given title and message.
Uses `title` as the toast id, which means resending will update
in place instead of re-popping.
---
### removeToast
```java
void removeToast(Player player, String id)
```
Removes an active toast by id. Triggers the pop-out animation if the
toast is currently live; no-op otherwise.
| Parameter | Type | Description |
|---|---|---|
| `player` | `Player` | the target player |
| `id` | `String` | the id of the toast to remove |
---
### showScrollableScreen
```java
void showScrollableScreen(Player player, String screenId, String title, List<ScreenContent> content, List<ScreenButton> buttons)
```
Displays a scrollable text screen with content sections and buttons.
Content can include headings, paragraphs, bullets, dividers, and subtext.
Button clicks send a `gg.lode.lecternapi.api.event.ScrollableScreenClickEvent`
back to the server with the screen ID and button reference.
| Parameter | Type | Description |
|---|---|---|
| `player` | `Player` | the target player |
| `screenId` | `String` | a unique identifier for this screen instance |
| `title` | `String` | the screen title displayed at the top |
| `content` | `List<ScreenContent>` | ordered list of content sections |
| `buttons` | `List<ScreenButton>` | buttons displayed at the bottom of the screen |
---
### closeScrollableScreen
```java
void closeScrollableScreen(Player player)
```
Closes the currently displayed scrollable screen on the player's client.
| Parameter | Type | Description |
|---|---|---|
| `player` | `Player` | the target player |
---
### showConfigScreen
```java
void showConfigScreen(Player player, String screenId, String title, List<ConfigWidget> panelWidgets, List<ConfigWidget> contentWidgets)
```
Displays a config/settings screen with a left navigation panel and right content area.
Widget interactions send a `gg.lode.lecternapi.api.event.ConfigScreenChangeEvent`
back to the server. Screen closure sends a `gg.lode.lecternapi.api.event.ConfigScreenCloseEvent`.
| Parameter | Type | Description |
|---|---|---|
| `player` | `Player` | the target player |
| `screenId` | `String` | a unique identifier for this screen instance |
| `title` | `String` | the screen title |
| `panelWidgets` | `List<ConfigWidget>` | widgets for the left navigation panel |
| `contentWidgets` | `List<ConfigWidget>` | widgets for the main content area |
---
### closeConfigScreen
```java
void closeConfigScreen(Player player)
```
Closes the currently displayed config screen on the player's client.
| Parameter | Type | Description |
|---|---|---|
| `player` | `Player` | the target player |
---
## Example
A toast in the corner, then a screen the player can scroll:
```java
IUIManager ui = LecternAPI.getApi().getUIManager();
ui.showToast(player, "Objective complete", "Return to the camp");
```
A scrollable screen is a list of content blocks and a list of buttons. The button's reference is
what comes back to you in [[ScrollableScreenClickEvent]]:
```java
ui.showScrollableScreen(player, "rules", "Server Rules",
List.of(new ScreenContent.Heading("Be decent"),
new ScreenContent.Paragraph("No griefing, no slurs, no cheating."),
new ScreenContent.Divider(0xFF444444),
new ScreenContent.Bullet("Report problems with /report")),
List.of(ScreenButton.of("I agree", "accept")));
```
A config screen is the same idea with widgets. Values come back one at a time in
[[ConfigScreenChangeEvent]], so you save as the player changes things rather than on close:
```java
ui.showConfigScreen(player, "settings", "Settings",
List.of(new ConfigWidget.TextHeader("Display")),
List.of(new ConfigWidget.Toggle("Show hints", "hints", true),
new ConfigWidget.Slider("HUD scale", "scale", 0.5f, 2f, 1f, "x")));
```
---
## Related Pages
- [[Toast]]. Full control over a toast's colours, position and duration
- [[ScreenContent]]. The content blocks a scrollable screen can hold
- [[ConfigWidget]]. The widgets a config screen can hold
- [[ConfigScreenChangeEvent]]. Reading values back