# rmp::ui::Panel

> A container: a panel with a look of its own (`style`), and a look for everything inside it (`children`), which every descendant inherits -- the nearest container's wins.

Source: https://omardev29.github.io/rmp-docs/reference/classes/rmp-ui-Panel.html

struct `#include <rmp/ui.h>` [include/rmp/ui.h:1827](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/ui.h#L1827-L1848)

struct Panel

A container: a panel with a look of its own (`style`), and a look for everything inside it (`children`), which every descendant inherits — the nearest container's wins. Clickable as a whole when it has an on_click: an inventory slot, a card.

```cpp
rmp::ui::Panel shop{
    .style = { .background = DARKBROWN, .shadow = rmp::ui::Shadow{} },
    .children = { .text = GOLD, .font = title_font },
};
shop.show([&] { buy.show(); sell.show(); });
```

### `row`

bool row = false

field [include/rmp/ui.h:1828](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/ui.h#L1828)

Children left to right; false = top to bottom

### `box`

BoxOptions box{}

field [include/rmp/ui.h:1829](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/ui.h#L1829)

Its layout, as `panel()` takes it

### `background`

bool background = true

field [include/rmp/ui.h:1830](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/ui.h#L1830-L1831)

False: a bare row or column, which still styles its children

### `id`

std::string id{}

field [include/rmp/ui.h:1832](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/ui.h#L1832)

As `ButtonOptions::id:` for a shared label

### `style`

Style style{}

field [include/rmp/ui.h:1833](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/ui.h#L1833)

Its own look; see Style

### `children`

Style children{}

field [include/rmp/ui.h:1834](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/ui.h#L1834)

The look of everything inside it

### `on_click`

rmp::Callback<> on_click

field [include/rmp/ui.h:1835](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/ui.h#L1835)

Clicked: released on it, or Enter or A with the focus

### `on_hover`

rmp::Callback<> on_hover

field [include/rmp/ui.h:1836](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/ui.h#L1836)

The pointer arrived on it

### `on_unhover`

rmp::Callback<> on_unhover

field [include/rmp/ui.h:1837](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/ui.h#L1837)

...and left

### `on_press`

rmp::Callback<> on_press

field [include/rmp/ui.h:1838](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/ui.h#L1838)

The pointer went down on it

### `on_release`

rmp::Callback<> on_release

field [include/rmp/ui.h:1839](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/ui.h#L1839)

...and came up

### `show`, `shake`, `hovered`, `pressed`

template <class Body> bool show(Body &&body)

void shake()

bool hovered() const

bool pressed() const

function [include/rmp/ui.h:1842](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/ui.h#L1842)

Lays it out with `body` inside it; true on the frame it was clicked.

`show`: Lays it out here

`shake`: Shakes it, as `Button::shake()` does

`hovered`: The pointer is on it

`pressed`: Held down on it

### `ours`

KeptState ours

field [include/rmp/ui.h:1847](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/ui.h#L1847)

What it remembers; read it with the methods above
