Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / index / UiStyle

Type Alias: UiStyle ​

ts
type UiStyle = {
  fill?: UiPaint;
  border?: {
     width: number;
     paint: UiPaint;
  };
  radius?: number | [number, number, number, number];
  corners?: "round" | "cut";
  pattern?: UiPattern;
  shadows?: UiShadow[];
  edge?: {
     width: number;
     color: string;
  };
  opacity?: number;
  text?: UiTextStyle;
  hover?: UiStateStyle;
  pressed?: UiStateStyle;
  selected?: UiStateStyle;
  disabled?: UiStateStyle;
  motion?: UiMotion;
};

Defined in: ui/uiStyle.ts:81

Properties ​

PropertyTypeDescriptionDefined in
fill?UiPaint-ui/uiStyle.ts:82
border?{ width: number; paint: UiPaint; }-ui/uiStyle.ts:83
border.widthnumber-ui/uiStyle.ts:83
border.paintUiPaint-ui/uiStyle.ts:83
radius?number | [number, number, number, number]One radius, or top-left, top-right, bottom-right, bottom-left. A radius past half the short side is clamped there, so 1 always gives a pill.ui/uiStyle.ts:88
corners?"round" | "cut"cut bevels the corners by the radius instead of rounding them.ui/uiStyle.ts:90
pattern?UiPattern-ui/uiStyle.ts:91
shadows?UiShadow[]-ui/uiStyle.ts:92
edge?{ width: number; color: string; }A thin highlight along the top inner edge.ui/uiStyle.ts:94
edge.widthnumber-ui/uiStyle.ts:94
edge.colorstring-ui/uiStyle.ts:94
opacity?number0–1. Multiplies down the widget tree, so fading a panel fades its menu.ui/uiStyle.ts:96
text?UiTextStyle-ui/uiStyle.ts:97
hover?UiStateStyleDrawn over the widget while a pointer is on it (buttons).ui/uiStyle.ts:99
pressed?UiStateStyleDrawn while it's held down (buttons).ui/uiStyle.ts:101
selected?UiStateStyleA button with selected on: the current tab, the chosen card.ui/uiStyle.ts:103
disabled?UiStateStyleA button with disabled on. It takes no hover or press.ui/uiStyle.ts:105
motion?UiMotion-ui/uiStyle.ts:106