Skip to content

five-on-it / apps/client/src/gui/layout / ButtonSpec

Interface: ButtonSpec ​

Defined in: apps/client/src/gui/layout.ts:28

A button: what it says, the key that presses it, whether it can be pressed, what it does.

Properties ​

badge? ​

optional badge?: object

Defined in: apps/client/src/gui/layout.ts:46

A count in its corner (the phone's unread messages), and its name.

id ​

id: string

text ​

text: string


detail? ​

optional detail?: object

Defined in: apps/client/src/gui/layout.ts:44

A second text at its end in its own colour (a shop's price).

text ​

text: string

tone ​

tone: "clear" | "green" | "red" | "price" | "note" | "line" | "button" | "blue" | "accent" | "fg" | "dim" | "bg" | "bgDense" | "buttonHover" | "lineStrong" | "gold" | "cyan" | "danger" | "dangerLine" | "ink"


enabled? ​

optional enabled?: boolean

Defined in: apps/client/src/gui/layout.ts:36

False greys it out and takes no click (true by default).


fill? ​

optional fill?: "clear" | "green" | "red" | "price" | "note" | "line" | "button" | "blue" | "accent" | "fg" | "dim" | "bg" | "bgDense" | "buttonHover" | "lineStrong" | "gold" | "cyan" | "danger" | "dangerLine" | "ink"

Defined in: apps/client/src/gui/layout.ts:42

The background (a control's light one by default; the dark one where no panel lies behind).


id ​

id: string

Defined in: apps/client/src/gui/layout.ts:30

Its name: the end-to-end tests' contract (the overlay's element ids before).


key? ​

optional key?: string

Defined in: apps/client/src/gui/layout.ts:34

The key that presses it, shown in a cap before the text.


minWidth? ​

optional minWidth?: number

Defined in: apps/client/src/gui/layout.ts:53

Never narrower than this (px).


note? ​

optional note?: string

Defined in: apps/client/src/gui/layout.ts:51

A tile's short last line of its own, at its end (a slot's count): a narrowed tile cuts its text to the one line above it.


press ​

press: () => void

Defined in: apps/client/src/gui/layout.ts:55

What a click does.

Returns ​

void


selected? ​

optional selected?: boolean

Defined in: apps/client/src/gui/layout.ts:38

Marked as the one selected (an inventory slot).


text ​

text: string

Defined in: apps/client/src/gui/layout.ts:32

What it says.


tone? ​

optional tone?: "clear" | "green" | "red" | "price" | "note" | "line" | "button" | "blue" | "accent" | "fg" | "dim" | "bg" | "bgDense" | "buttonHover" | "lineStrong" | "gold" | "cyan" | "danger" | "dangerLine" | "ink"

Defined in: apps/client/src/gui/layout.ts:40

The text's colour.