Skip to content

1681-engine / react / UiProviderProps

Interface: UiProviderProps ​

Defined in: src/react/UiProvider.tsx:39

1681 Engine's React kit (1681-engine/react): the windows, tabs, lists, drop-downs, tooltips, dialogs and sliders a game's DOM UI is built from, laid out by the engine's own layout maths (fitToViewport, placeTooltip, listWidth) and themed by CSS custom properties (baseCss). React and React DOM are optional peer dependencies: only a game that imports this entry needs them, and the core and 1681-engine/ui never import React.

Every word on screen is the game's: a prop, or UiProvider's labels, with an English default.

Extends ​

Properties ​

children? ​

ts
optional children?: ReactNode;

Defined in: src/react/UiProvider.tsx:41


classNames? ​

ts
optional classNames?: Readonly<Record<string, string>>;

Defined in: src/react/UiProvider.tsx:34

A game's own class names hung beside the kit's, keyed by the kit's name without its prefix (tabs, tab, button, select-list…) or by a state (picked, open): a game whose stylesheet already styles its own names takes the kit without rewriting it. Default none.

Inherited from ​

UiSettings.classNames


labels? ​

ts
optional labels?: Partial<UiLabels>;

Defined in: src/react/UiProvider.tsx:40


margin? ​

ts
optional margin?: number;

Defined in: src/react/UiProvider.tsx:21

Kept clear between a window and the screen's edges (default 8).

Inherited from ​

UiSettings.margin


minScale? ​

ts
optional minScale?: number;

Defined in: src/react/UiProvider.tsx:17

The smallest scale a window may shrink to before its body scrolls instead (default: scale, never shrinks).

Inherited from ​

UiSettings.minScale


portal? ​

ts
optional portal?: () => HTMLElement | null;

Defined in: src/react/UiProvider.tsx:28

Where tooltips, the select's list and dialogs are portalled. Default: document.body.

Returns ​

HTMLElement | null

Inherited from ​

UiSettings.portal


scale? ​

ts
optional scale?: number;

Defined in: src/react/UiProvider.tsx:15

The scale windows and dialogs are meant to be drawn at (fitToViewport's scale): a whole multiple for a pixel-art UI laid out on small units. Default 1.

Inherited from ​

UiSettings.scale


sheetScale? ​

ts
optional sheetScale?: number;

Defined in: src/react/UiProvider.tsx:19

A player's "window size" for touch sheets: laid out on a box 1 / sheetScale the screen and drawn back down.

Inherited from ​

UiSettings.sheetScale


snap? ​

ts
optional snap?: boolean;

Defined in: src/react/UiProvider.tsx:23

Positions and sizes land on whole pixels (default true): pixel art at x.5 reads blurred.

Inherited from ​

UiSettings.snap


touch? ​

ts
optional touch?: boolean;

Defined in: src/react/UiProvider.tsx:10

Fingers, not a mouse: windows become full-screen sheets, tooltips are not shown. Default: isTouchUi().

Inherited from ​

UiSettings.touch


viewport? ​

ts
optional viewport?: () => Size;

Defined in: src/react/UiProvider.tsx:26

The box windows, tooltips and lists are placed in. Default: the browser window.

Returns ​

Size

Inherited from ​

UiSettings.viewport

Released under the MIT License.