Skip to content

react-components

Interfaces

RadioButtonItem

Defined in: react-components/RadioButtons.tsx:10

Single item descriptor for RadioButtons group.

Type Parameters

Type Parameter
T

Properties

PropertyTypeDescriptionDefined in
keyTUnique value or identifier for this radio choice.react-components/RadioButtons.tsx:12
captionLocalisedStringLocalised caption to display next to the radio button.react-components/RadioButtons.tsx:14

RadioButtonsProps

Defined in: react-components/RadioButtons.tsx:20

Props for the RadioButtons group component.

Type Parameters

Type Parameter
T

Properties

PropertyTypeDescriptionDefined in
buttons?RadioButtonItem<T>[]Array of radio button item choices.react-components/RadioButtons.tsx:22
value?TCurrently selected choice key.react-components/RadioButtons.tsx:24
onChange?(this: void, value: T) => voidCallback fired with the newly selected key when the user selects a choice.react-components/RadioButtons.tsx:26
direction?"vertical" | "horizontal"Layout direction for the radio group. Default "vertical"react-components/RadioButtons.tsx:31

SectionSlotData

Defined in: react-components/SectionGroup.tsx:49

Properties

PropertyTypeDefined in
signal?SignalIDreact-components/SectionGroup.tsx:50
count?numberreact-components/SectionGroup.tsx:51
selected?booleanreact-components/SectionGroup.tsx:52
upper?numberreact-components/SectionGroup.tsx:53

SectionGroupProps

Defined in: react-components/SectionGroup.tsx:56

Properties

PropertyTypeDescriptionDefined in
key?Key-react-components/SectionGroup.tsx:57
name?stringName of the groupreact-components/SectionGroup.tsx:59
placeholder?stringPlaceholder text when name is emptyreact-components/SectionGroup.tsx:61
active?booleanWhether the section is active / enabledreact-components/SectionGroup.tsx:63
onActiveChange?(this: void, active: boolean) => voidCallback when active checkbox state changesreact-components/SectionGroup.tsx:65
onNameChange?(this: void, newName: string) => voidCallback when name is editedreact-components/SectionGroup.tsx:67
onDelete?(this: void) => voidCallback when section is deletedreact-components/SectionGroup.tsx:69
slotCount?numberTotal number of slots to display (default: 10)react-components/SectionGroup.tsx:71
columnCount?numberNumber of columns in slot table (default: 10)react-components/SectionGroup.tsx:73
tableStyle?anyStyle for slot table (default: “table”)react-components/SectionGroup.tsx:75
slots?| Record<number, SectionSlotData> | SectionSlotData[]Array or Record of slot data (1-based index or array)react-components/SectionGroup.tsx:77
selectedSlot?numberCurrently selected slot index (1-based)react-components/SectionGroup.tsx:79
onSlotClick?(this: void, slotIndex: number, ev: OnGuiClickEvent) => voidCallback when a slot is clickedreact-components/SectionGroup.tsx:81
onSlotChange?(this: void, slotIndex: number, signal: any, ev: any) => voidCallback when a slot’s signal is changed / chosen in pickerreact-components/SectionGroup.tsx:83
styles?StylesFor<"flow">Custom styles for the root container flowreact-components/SectionGroup.tsx:85

WindowFrameProps

Defined in: react-components/WindowFrame.tsx:10

Props for the WindowFrame top-level dialog component.

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
captionLocalisedStringWindow title displayed in the header titlebar.FrameProps.caption-react-components/WindowFrame.tsx:12
playerIndex?PlayerIndexPlayer index owning this window (used for position memory and pin state).--react-components/WindowFrame.tsx:14
pinnable?booleanIf true, shows the pin button and persists pinned state per player. Default false--react-components/WindowFrame.tsx:19
defaultPinned?booleanInitial pinned state when uncontrolled.--react-components/WindowFrame.tsx:21
autoCenter?booleanAutomatically centers the window in the viewport when opened.--react-components/WindowFrame.tsx:23
windowKey?stringUnique storage key for saving window position and pin state.--react-components/WindowFrame.tsx:25
locationDebounceTicks?numberDelay in game ticks before saving dragged window position to storage. Default: 30 (0.5s).--react-components/WindowFrame.tsx:27
draggable?booleanWhether the window can be dragged by its titlebar. Default true--react-components/WindowFrame.tsx:32
closable?booleanWhether to show a close button in the titlebar. Default true--react-components/WindowFrame.tsx:37
onClose?(this: void, ev?: OnGuiClickEvent) => voidCallback fired when the window is closed.--react-components/WindowFrame.tsx:39
pinned?booleanControlled pinned state.--react-components/WindowFrame.tsx:41
onTogglePin?(this: void, pinned: boolean, ev?: OnGuiClickEvent) => voidCallback fired when the player toggles the pin state.--react-components/WindowFrame.tsx:43
dragHandleRef?(this: void, elem: any) => voidRef callback to access the draggable empty widget element.--react-components/WindowFrame.tsx:45
titleDecoration?| ReactNode | ReactNode[]Extra React nodes rendered in the titlebar between title and action buttons.--react-components/WindowFrame.tsx:47
anchor?GuiAnchor--FrameProps.anchorreact/generated-props.ts:124
auto_center?boolean--FrameProps.auto_centerreact/generated-props.ts:125
direction?GuiDirection--FrameProps.directionreact/generated-props.ts:127
drag_target?FrameGuiElement--FrameProps.drag_targetreact/generated-props.ts:128
elem_tooltip?ElemID--FrameProps.elem_tooltipreact/generated-props.ts:129
enabled?boolean--FrameProps.enabledreact/generated-props.ts:130
game_controller_interaction?game_controller_interaction--FrameProps.game_controller_interactionreact/generated-props.ts:131
ignored_by_interaction?boolean--FrameProps.ignored_by_interactionreact/generated-props.ts:132
index?number--FrameProps.indexreact/generated-props.ts:133
location?any--FrameProps.locationreact/generated-props.ts:134
locked?boolean--FrameProps.lockedreact/generated-props.ts:135
name?string--FrameProps.namereact/generated-props.ts:136
raise_hover_events?boolean--FrameProps.raise_hover_eventsreact/generated-props.ts:137
tooltip?LocalisedString--FrameProps.tooltipreact/generated-props.ts:138
visible?boolean--FrameProps.visiblereact/generated-props.ts:139
ref?Ref<any>Ref callback or mutable ref object to capture the live C++ LuaGuiElement.-FrameProps.refreact/types.ts:411
children?| ReactNode | ReactNode[]Child JSX elements.-FrameProps.childrenreact/types.ts:417
styles?StylesFor<E>Custom style overrides passed as an object (e.g. { width: 100, font: "default-bold" }).-FrameProps.stylesreact/types.ts:419
style?anyPrototype style name defined in Factorio prototypes (e.g. "frame", "subheader_frame").-FrameProps.stylereact/types.ts:421
onClosed?(this: void, event: TypedEvent<OnGuiClosedEvent, "frame">) => void--FrameProps.onClosed
onHover?(this: void, event: TypedEvent<OnGuiHoverEvent, "frame">) => void--FrameProps.onHover
onLeave?(this: void, event: TypedEvent<OnGuiLeaveEvent, "frame">) => void--FrameProps.onLeave
onLocationChanged?(this: void, event: TypedEvent<OnGuiLocationChangedEvent, "frame">) => void--FrameProps.onLocationChanged
onOpened?(this: void, event: TypedEvent<OnGuiOpenedEvent, "frame">) => void--FrameProps.onOpened

Type Aliases

ButtonProps

type ButtonProps = PrimitiveProps<"button">;

Defined in: react-components/Button.tsx:6

Props for the Factorio Button component.


CameraProps

type CameraProps = PrimitiveProps<"camera">;

Defined in: react-components/Camera.tsx:6

Props for the Camera component.


CheckboxProps

type CheckboxProps = Omit<PrimitiveProps<"checkbox">, "onCheckedStateChanged"> & object;

Defined in: react-components/Checkbox.tsx:7

Props for the Factorio Checkbox component.

Type Declaration

NameTypeDescriptionDefined in
onChange()?(this: void, state: boolean, ev: Color) => voidCallback fired when the player changes the checked state. Provides the new boolean state directly as the first argument.react-components/Checkbox.tsx:12

CloseButtonProps

type CloseButtonProps = SpriteButtonProps;

Defined in: react-components/CloseButton.tsx:7

Props for the Factorio CloseButton component.


type DropdownOption<T> = object;

Defined in: react-components/Dropdown.tsx:7

Option entry for key-value Dropdown.

Type Parameters

Type ParameterDefault type
Tstring | number

Properties

PropertyTypeDescriptionDefined in
keyTUnique key or enum value corresponding to the option.react-components/Dropdown.tsx:9
captionColorLocalised string or caption to display in the dropdown list.react-components/Dropdown.tsx:11

type DropdownProps<T> = Omit<PrimitiveProps<"drop-down">, "items" | "selected_index" | "onSelectionStateChanged"> & object;

Defined in: react-components/Dropdown.tsx:18

Props for the Factorio Dropdown component. Supports both high-level key-value options and native 1-based items.

Type Declaration

NameTypeDescriptionDefined in
options?DropdownOption<T>[]List of structured options with keys and captions.react-components/Dropdown.tsx:20
value?TCurrently selected option key when using options.react-components/Dropdown.tsx:22
onChange()?(this: void, value: T, index: number, ev: Color) => voidCallback fired with the selected option’s key, 1-based index, and native event.react-components/Dropdown.tsx:24
items?Color[]Native Factorio list of item captions.react-components/Dropdown.tsx:27
selected_index?numberNative 1-based selected index.react-components/Dropdown.tsx:29
onSelectionStateChanged()?(this: void, ev: Color) => voidLow-level Factorio selection event handler.react-components/Dropdown.tsx:31

Type Parameters

Type ParameterDefault type
Tstring | number

EmptyWidgetProps

type EmptyWidgetProps = PrimitiveProps<"empty-widget">;

Defined in: react-components/EmptyWidget.tsx:6

Props for the Factorio EmptyWidget component.


EntityPreviewProps

type EntityPreviewProps = PrimitiveProps<"entity-preview">;

Defined in: react-components/EntityPreview.tsx:6

Props for the EntityPreview component.


FixedWindowFrameProps

type FixedWindowFrameProps = FrameProps;

Defined in: react-components/FixedWindowFrame.tsx:7

Props for the FixedWindowFrame component.


FrameProps

type FrameProps = PrimitiveProps<"frame">;

Defined in: react-components/Frame.tsx:6

Props for the Frame component.


HFlowProps

type HFlowProps = Omit<PrimitiveProps<"flow">, "direction">;

Defined in: react-components/HFlow.tsx:6

Props for the HFlow component.


IndicatorProps

type IndicatorProps = Omit<SpriteProps, "sprite" | "children"> & object;

Defined in: react-components/Indicator.tsx:9

Props for the Indicator LED status component.

Type Declaration

NameTypeDescriptionDefined in
color?IndicatorColorStatus color for the LED dot. Default "green"react-components/Indicator.tsx:14

InputProps

type InputProps = Omit<PrimitiveProps<"textfield">, "onTextChanged" | "onConfirmed" | "ref"> & object;

Defined in: react-components/Input.tsx:7

Props for the Factorio Input (textfield) component.

Type Declaration

NameTypeDescriptionDefined in
ref?Ref<Color>Reference to the underlying native TextFieldGuiElement.react-components/Input.tsx:9
min_value?numberMinimum numeric value allowed when numeric is true.react-components/Input.tsx:11
max_value?numberMaximum numeric value allowed when numeric is true.react-components/Input.tsx:13
clamp_on_change?booleanAutomatically clamps the input text to [min_value, max_value] on every keystroke. Default falsereact-components/Input.tsx:18
debounceTicks?numberDelay in game ticks before firing onChange. When specified, debounces rapid keystrokes (e.g. debounceTicks={30}).react-components/Input.tsx:23
onChange()?(this: void, text: string, ev: Color, numericValue?: number) => voidCallback fired when text changes. Receives string text as 1st arg and parsed integer as 3rd arg (if numeric).react-components/Input.tsx:28
onConfirm()?(this: void, text: string, ev: Color, numericValue?: number) => voidCallback fired when the player presses Enter/Confirm in the textfield.react-components/Input.tsx:32

LabelProps

type LabelProps = PrimitiveProps<"label"> & object;

Defined in: react-components/Label.tsx:7

Props for the Factorio Label component.

Type Declaration

NameTypeDescriptionDefined in
bold?booleanIf true, applies font = "default-bold".react-components/Label.tsx:9
large?booleanIf true, applies font = "default-large".react-components/Label.tsx:11
richText?booleanIf true, enables rich text tags [item=...], [color=...] in caption.react-components/Label.tsx:13
multiline?booleanIf true, allows the text to wrap across multiple lines (single_line = false).react-components/Label.tsx:15

LabeledProps

type LabeledProps = HFlowProps & object;

Defined in: react-components/Labeled.tsx:10

Props for the Labeled form row component.

Type Declaration

NameTypeDescriptionDefined in
captionColorText or localized string for the left label.react-components/Labeled.tsx:12
label_props?LabelPropsOptional custom props forwarded to the Label component.react-components/Labeled.tsx:14

LineProps

type LineProps = PrimitiveProps<"line">;

Defined in: react-components/Line.tsx:6

Props for the Line component.


ListboxProps

type ListboxProps = PrimitiveProps<"list-box">;

Defined in: react-components/Listbox.tsx:6

Props for the Factorio Listbox component.


MinimapProps

type MinimapProps = PrimitiveProps<"minimap">;

Defined in: react-components/Minimap.tsx:6

Props for the Minimap component.


PinButtonProps

type PinButtonProps = SpriteButtonProps & object;

Defined in: react-components/PinButton.tsx:8

Props for the PinButton component.

Type Declaration

NameTypeDescriptionDefined in
pinned?booleanCurrent pinned state of the window.react-components/PinButton.tsx:10
onTogglePin()?(this: void, pinned: boolean, ev: Color) => voidCallback fired when the player toggles the pin button.react-components/PinButton.tsx:12

ProgressBarProps

type ProgressBarProps = PrimitiveProps<"progressbar">;

Defined in: react-components/ProgressBar.tsx:6

Props for the Factorio ProgressBar component.


RadioButtonProps

type RadioButtonProps = PrimitiveProps<"radiobutton">;

Defined in: react-components/RadioButton.tsx:6

Props for the Factorio RadioButton component.


ScrollPaneProps

type ScrollPaneProps = PrimitiveProps<"scroll-pane">;

Defined in: react-components/ScrollPane.tsx:6

Props for the Factorio ScrollPane component.


ShallowSectionProps

type ShallowSectionProps = FrameProps;

Defined in: react-components/ShallowSection.tsx:8

Props for the ShallowSection component.


SliderProps

type SliderProps = Omit<PrimitiveProps<"slider">, "onValueChanged" | "value" | "slider_value"> & object;

Defined in: react-components/Slider.tsx:7

Props for the Factorio Slider component.

Type Declaration

NameTypeDescriptionDefined in
value?numberNumeric value of the slider.react-components/Slider.tsx:9
debounceTicks?numberDelay in game ticks before firing onChange. When specified, debounces rapid sliding adjustments (e.g. debounceTicks={15}).react-components/Slider.tsx:14
onChange()?(this: void, value: number, ev: Color) => voidCallback fired when the slider value is changed by the player.react-components/Slider.tsx:16

SlotButtonProps

type SlotButtonProps = Omit<PrimitiveProps<"choose-elem-button">, "onElemChanged" | "elem_value" | "elem_type"> & object;

Defined in: react-components/SlotButton.tsx:8

Props for the SlotButton component.

Type Declaration

NameTypeDescriptionDefined in
signal?ColorThe active signal to display in the slot.react-components/SlotButton.tsx:10
onChange()?(this: void, signal: Color | undefined, ev: Color) => voidCallback fired when the player changes or clears the signal.react-components/SlotButton.tsx:12
locked?booleanIf true, the slot button cannot open the native signal picker; clicks trigger onClick.react-components/SlotButton.tsx:14
count?number | stringNumeric count badge displayed in the lower-right corner (auto-formatted with SI units) or custom string.react-components/SlotButton.tsx:16
count_color?ColorCustom text color for the count label.react-components/SlotButton.tsx:18
upper?number | stringOptional secondary numeric badge displayed in the upper-right corner or custom string.react-components/SlotButton.tsx:20
upper_color?ColorCustom text color for the upper label.react-components/SlotButton.tsx:22
selected?booleanIf true, applies active yellow border selection style.react-components/SlotButton.tsx:24
onClick()?(this: void, ev: Color) => voidCallback fired when the slot is clicked (especially in locked mode).react-components/SlotButton.tsx:26

SlotButtonTableProps

type SlotButtonTableProps = TableProps;

Defined in: react-components/SlotButtonTable.tsx:7

Props for the SlotButtonTable grid component.


SpriteProps

type SpriteProps = PrimitiveProps<"sprite">;

Defined in: react-components/Sprite.tsx:6

Props for the Sprite component.


SpriteButtonProps

type SpriteButtonProps = PrimitiveProps<"sprite-button">;

Defined in: react-components/SpriteButton.tsx:6

Props for the Factorio SpriteButton component.


SwitchProps

type SwitchProps = Omit<PrimitiveProps<"switch">, "onSwitchStateChanged"> & object;

Defined in: react-components/Switch.tsx:7

Props for the Factorio Switch component.

Type Declaration

NameTypeDescriptionDefined in
value?Color | boolean | 0 | 1 | 2Current switch state. Accepts `“left”“right”
onChange()?(this: void, state: Color, ev: Color) => voidCallback fired when the switch position changes.react-components/Switch.tsx:14

TabProps

type TabProps = Omit<PrimitiveProps<"tab">, "children"> & object;

Defined in: react-components/Tab.tsx:7

Props for the Tab definition component.

Type Declaration

NameTypeDescriptionDefined in
captionColorText or localized string displayed on the tab header button.react-components/Tab.tsx:9
badge_text?ColorOptional badge text displayed on the tab header (e.g. item count or notification).react-components/Tab.tsx:11
children| ReactNode | ReactNode[]Content to render when this tab is active.react-components/Tab.tsx:13

TabbedPaneProps

type TabbedPaneProps = object;

Defined in: react-components/TabbedPane.tsx:14

Props for the TabbedPane multi-tab container.

Properties

PropertyTypeDescriptionDefined in
children?ReactNode<Tab> child elements.react-components/TabbedPane.tsx:16
selected_tab_index?numberControlled 1-based index of the active tab.react-components/TabbedPane.tsx:18
default_tab_index?numberInitial active tab index (1-based) in uncontrolled mode. Default 1react-components/TabbedPane.tsx:23
onSelectedTabChanged?(this: void, index: number) => voidCallback fired when the active tab index changes.react-components/TabbedPane.tsx:25
styles?StylesFor<"flow">Custom styles applied to the outer layout container flow.react-components/TabbedPane.tsx:27

TableProps

type TableProps = PrimitiveProps<"table">;

Defined in: react-components/Table.tsx:6

Props for the Table component.


TitlebarProps

type TitlebarProps = HFlowProps & object;

Defined in: react-components/Titlebar.tsx:11

Props for the Titlebar window header component.

Type Declaration

NameTypeDescriptionDefined in
caption?ColorTitle text or localized string.react-components/Titlebar.tsx:13
draggable?booleanWhether to display a draggable spacer across the header. Default truereact-components/Titlebar.tsx:18
closable?booleanWhether to display a close button. Default truereact-components/Titlebar.tsx:23
onClose()?(this: void, ev?: Color) => voidCallback fired when the close button is clicked.react-components/Titlebar.tsx:25
dragHandleRef()?(this: void, elem: Color | undefined) => voidRef callback to access the draggable empty widget element.react-components/Titlebar.tsx:27
drag_target?ColorNative parent frame target for dragging.react-components/Titlebar.tsx:29

VFlowProps

type VFlowProps = Omit<PrimitiveProps<"flow">, "direction">;

Defined in: react-components/VFlow.tsx:6

Props for the VFlow component.


WellFoldProps

type WellFoldProps = Omit<WellSectionProps, "header_decoration" | "collapsed"> & object;

Defined in: react-components/WellFold.tsx:8

Props for the WellFold collapsible section component.

Type Declaration

NameTypeDescriptionDefined in
defaultCollapsed?booleanWhether the section starts collapsed by default. Default truereact-components/WellFold.tsx:13

WellHeaderProps

type WellHeaderProps = FrameProps & object;

Defined in: react-components/WellHeader.tsx:9

Props for the WellHeader component.

Type Declaration

NameTypeDescriptionDefined in
caption_element?ReactNodeOptional custom React node used as caption element.react-components/WellHeader.tsx:11

WellSectionProps

type WellSectionProps = VFlowProps & object;

Defined in: react-components/WellSection.tsx:9

Props for the WellSection container component.

Type Declaration

NameTypeDescriptionDefined in
caption?ColorText or localized string caption for the header bar.react-components/WellSection.tsx:11
caption_element?ReactNodeOptional custom React node for the header caption.react-components/WellSection.tsx:13
collapsed?booleanWhether the body content is hidden.react-components/WellSection.tsx:15
header_decoration?| ReactNode | ReactNode[]Optional right-aligned action buttons or badges in the header bar.react-components/WellSection.tsx:17

Functions

Button()

function Button(props: ButtonProps): ReactElement<ButtonProps, any>;

Defined in: react-components/Button.tsx:20

Standard Factorio push button component.

Parameters

ParameterType
propsButtonProps

Returns

ReactElement<ButtonProps, any>

Example

<Button
caption="Click Me"
style="confirm_button"
onClick={(ev) => log("Button clicked")}
/>

Camera()

function Camera(props: CameraProps): ReactElement<CameraProps, any>;

Defined in: react-components/Camera.tsx:11

World camera view element.

Parameters

ParameterType
propsCameraProps

Returns

ReactElement<CameraProps, any>


Checkbox()

function Checkbox(props: CheckboxProps): ReactElement<{
onCheckedStateChanged: (ev: OnGuiCheckedStateChangedEvent) => void;
anchor?: GuiAnchor;
caption?: LocalisedString;
elem_tooltip?: ElemID;
enabled?: boolean;
game_controller_interaction?: game_controller_interaction;
ignored_by_interaction?: boolean;
index?: number;
location?: any;
locked?: boolean;
name?: string;
raise_hover_events?: boolean;
state?: boolean;
tooltip?: LocalisedString;
visible?: boolean;
ref?: Ref<any>;
children?: | ReactNode
| ReactNode[];
styles?: StylesFor<E>;
style?: any;
onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "checkbox">) => void;
onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "checkbox">) => void;
onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "checkbox">) => void;
onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "checkbox">) => void;
onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "checkbox">) => void;
}, any>;

Defined in: react-components/Checkbox.tsx:27

Native Factorio checkbox component with ergonomic onChange boolean callback.

Parameters

ParameterType
propsCheckboxProps

Returns

ReactElement<{ onCheckedStateChanged: (ev: OnGuiCheckedStateChangedEvent) => void; anchor?: GuiAnchor; caption?: LocalisedString; elem_tooltip?: ElemID; enabled?: boolean; game_controller_interaction?: game_controller_interaction; ignored_by_interaction?: boolean; index?: number; location?: any; locked?: boolean; name?: string; raise_hover_events?: boolean; state?: boolean; tooltip?: LocalisedString; visible?: boolean; ref?: Ref<any>; children?: | ReactNode | ReactNode[]; styles?: StylesFor<E>; style?: any; onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "checkbox">) => void; onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "checkbox">) => void; onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "checkbox">) => void; onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "checkbox">) => void; onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "checkbox">) => void; }, any>

Example

<Checkbox
caption="Enable Auto-crafting"
state={isEnabled}
onChange={(checked) => setIsEnabled(checked)}
/>

CloseButton()

function CloseButton(props: SpriteButtonProps): any;

Defined in: react-components/CloseButton.tsx:18

Standard Factorio window close action button (red cross in titlebar). Pre-configured with frame_action_button style and utility/close sprite.

Parameters

ParameterType
propsSpriteButtonProps

Returns

any

Example

<CloseButton onClick={() => setOpened(false)} />

function Dropdown<T>(props: DropdownProps<T>): ReactElement<{
items: LocalisedString[];
selected_index: number;
onSelectionStateChanged: (ev: OnGuiSelectionStateChangedEvent) => void;
anchor?: GuiAnchor;
caption?: LocalisedString;
elem_tooltip?: ElemID;
enabled?: boolean;
game_controller_interaction?: game_controller_interaction;
ignored_by_interaction?: boolean;
index?: number;
location?: any;
locked?: boolean;
name?: string;
raise_hover_events?: boolean;
tooltip?: LocalisedString;
visible?: boolean;
ref?: Ref<any>;
children?: | ReactNode
| ReactNode[];
styles?: StylesFor<E>;
style?: any;
onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "drop-down">) => void;
onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "drop-down">) => void;
onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "drop-down">) => void;
onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "drop-down">) => void;
onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "drop-down">) => void;
}, any>;

Defined in: react-components/Dropdown.tsx:49

Dropdown selector component supporting both key-value options and raw Factorio items.

Type Parameters

Type ParameterDefault type
Tstring | number

Parameters

ParameterType
propsDropdownProps<T>

Returns

ReactElement<{ items: LocalisedString[]; selected_index: number; onSelectionStateChanged: (ev: OnGuiSelectionStateChangedEvent) => void; anchor?: GuiAnchor; caption?: LocalisedString; elem_tooltip?: ElemID; enabled?: boolean; game_controller_interaction?: game_controller_interaction; ignored_by_interaction?: boolean; index?: number; location?: any; locked?: boolean; name?: string; raise_hover_events?: boolean; tooltip?: LocalisedString; visible?: boolean; ref?: Ref<any>; children?: | ReactNode | ReactNode[]; styles?: StylesFor<E>; style?: any; onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "drop-down">) => void; onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "drop-down">) => void; onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "drop-down">) => void; onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "drop-down">) => void; onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "drop-down">) => void; }, any>

Example

<Dropdown
options={[
{ key: "item", caption: "Items" },
{ key: "fluid", caption: "Fluids" },
]}
value={selectedMode}
onChange={(mode) => setSelectedMode(mode)}
/>

EmptyWidget()

function EmptyWidget(props: EmptyWidgetProps): ReactElement<EmptyWidgetProps, any>;

Defined in: react-components/EmptyWidget.tsx:18

Factorio empty-widget component. Commonly used as a flexible spacer (horizontally_stretchable: true) or titlebar drag handle (drag_target).

Parameters

ParameterType
propsEmptyWidgetProps

Returns

ReactElement<EmptyWidgetProps, any>

Example

// Flexible spacer in a toolbar
<EmptyWidget styles={{ horizontally_stretchable: true }} />

EntityPreview()

function EntityPreview(props: EntityPreviewProps): ReactElement<EntityPreviewProps, any>;

Defined in: react-components/EntityPreview.tsx:11

Entity preview element.

Parameters

ParameterType
propsEntityPreviewProps

Returns

ReactElement<EntityPreviewProps, any>


FixedWindowFrame()

function FixedWindowFrame(props: FrameProps): any;

Defined in: react-components/FixedWindowFrame.tsx:20

Non-draggable window frame container with vertical direction. Suitable for fixed HUD overlays, side panels, or embedded viewports.

Parameters

ParameterType
propsFrameProps

Returns

any

Example

<FixedWindowFrame style="inside_shallow_frame">
<Label caption="Status Panel" />
</FixedWindowFrame>

Frame()

function Frame(props: FrameProps): ReactElement<{
style: any;
anchor?: GuiAnchor;
auto_center?: boolean;
caption?: LocalisedString;
direction?: GuiDirection;
drag_target?: FrameGuiElement;
elem_tooltip?: ElemID;
enabled?: boolean;
game_controller_interaction?: game_controller_interaction;
ignored_by_interaction?: boolean;
index?: number;
location?: any;
locked?: boolean;
name?: string;
raise_hover_events?: boolean;
tooltip?: LocalisedString;
visible?: boolean;
ref?: Ref<any>;
children?: | ReactNode
| ReactNode[];
styles?: StylesFor<E>;
onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "frame">) => void;
onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "frame">) => void;
onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "frame">) => void;
onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "frame">) => void;
onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "frame">) => void;
}, any>;

Defined in: react-components/Frame.tsx:18

Generic Factorio frame component.

Parameters

ParameterType
propsFrameProps

Returns

ReactElement<{ style: any; anchor?: GuiAnchor; auto_center?: boolean; caption?: LocalisedString; direction?: GuiDirection; drag_target?: FrameGuiElement; elem_tooltip?: ElemID; enabled?: boolean; game_controller_interaction?: game_controller_interaction; ignored_by_interaction?: boolean; index?: number; location?: any; locked?: boolean; name?: string; raise_hover_events?: boolean; tooltip?: LocalisedString; visible?: boolean; ref?: Ref<any>; children?: | ReactNode | ReactNode[]; styles?: StylesFor<E>; onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "frame">) => void; onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "frame">) => void; onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "frame">) => void; onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "frame">) => void; onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "frame">) => void; }, any>

Example

<Frame style="inside_shallow_frame" direction="vertical">
<Label caption="Section content" />
</Frame>

HFlow()

function HFlow(props: HFlowProps): ReactElement<{
direction: string;
anchor?: GuiAnchor;
caption?: LocalisedString;
drag_target?: FrameGuiElement;
elem_tooltip?: ElemID;
enabled?: boolean;
game_controller_interaction?: game_controller_interaction;
ignored_by_interaction?: boolean;
index?: number;
location?: any;
locked?: boolean;
name?: string;
raise_hover_events?: boolean;
tooltip?: LocalisedString;
visible?: boolean;
ref?: Ref<any>;
children?: | ReactNode
| ReactNode[];
styles?: StylesFor<E>;
style?: any;
onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "flow">) => void;
onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "flow">) => void;
onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "flow">) => void;
onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "flow">) => void;
onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "flow">) => void;
}, any>;

Defined in: react-components/HFlow.tsx:19

Horizontal layout flow container (direction="horizontal").

Parameters

ParameterType
propsHFlowProps

Returns

ReactElement<{ direction: string; anchor?: GuiAnchor; caption?: LocalisedString; drag_target?: FrameGuiElement; elem_tooltip?: ElemID; enabled?: boolean; game_controller_interaction?: game_controller_interaction; ignored_by_interaction?: boolean; index?: number; location?: any; locked?: boolean; name?: string; raise_hover_events?: boolean; tooltip?: LocalisedString; visible?: boolean; ref?: Ref<any>; children?: | ReactNode | ReactNode[]; styles?: StylesFor<E>; style?: any; onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "flow">) => void; onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "flow">) => void; onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "flow">) => void; onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "flow">) => void; onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "flow">) => void; }, any>

Example

<HFlow styles={{ vertical_align: "center" }}>
<Label caption="Username:" />
<Input text={name} onChange={setName} />
</HFlow>

Indicator()

function Indicator(props: IndicatorProps): any;

Defined in: react-components/Indicator.tsx:25

Small circular status indicator LED (green, red, yellow, blue, etc.).

Parameters

ParameterType
propsIndicatorProps

Returns

any

Example

<Indicator color={isOnline ? "green" : "red"} tooltip={isOnline ? "Online" : "Offline"} />

Input()

function Input(props: InputProps): ReactElement<{
ref?: Ref<TextFieldGuiElement>;
numeric: boolean;
allow_negative: boolean;
lose_focus_on_confirm: boolean;
onTextChanged: (ev: OnGuiTextChangedEvent) => void;
onConfirmed: (ev: OnGuiConfirmedEvent) => void;
allow_decimal?: boolean;
anchor?: GuiAnchor;
caption?: LocalisedString;
elem_tooltip?: ElemID;
enabled?: boolean;
game_controller_interaction?: game_controller_interaction;
icon_selector?: boolean;
ignored_by_interaction?: boolean;
index?: number;
is_password?: boolean;
location?: any;
locked?: boolean;
name?: string;
raise_hover_events?: boolean;
text?: string;
tooltip?: LocalisedString;
visible?: boolean;
children?: | ReactNode
| ReactNode[];
styles?: StylesFor<E>;
style?: any;
onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "textfield">) => void;
onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "textfield">) => void;
onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "textfield">) => void;
onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "textfield">) => void;
onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "textfield">) => void;
}, any>;

Defined in: react-components/Input.tsx:56

Enhanced Factorio textfield component with numeric bounds clamping, Enter key confirmation (onConfirm), and ref focus support.

Parameters

ParameterType
propsInputProps

Returns

ReactElement<{ ref?: Ref<TextFieldGuiElement>; numeric: boolean; allow_negative: boolean; lose_focus_on_confirm: boolean; onTextChanged: (ev: OnGuiTextChangedEvent) => void; onConfirmed: (ev: OnGuiConfirmedEvent) => void; allow_decimal?: boolean; anchor?: GuiAnchor; caption?: LocalisedString; elem_tooltip?: ElemID; enabled?: boolean; game_controller_interaction?: game_controller_interaction; icon_selector?: boolean; ignored_by_interaction?: boolean; index?: number; is_password?: boolean; location?: any; locked?: boolean; name?: string; raise_hover_events?: boolean; text?: string; tooltip?: LocalisedString; visible?: boolean; children?: | ReactNode | ReactNode[]; styles?: StylesFor<E>; style?: any; onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "textfield">) => void; onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "textfield">) => void; onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "textfield">) => void; onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "textfield">) => void; onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "textfield">) => void; }, any>

Example

<Input
numeric={true}
allow_negative={true}
min_value={-100}
max_value={100}
text={countText}
debounceTicks={30}
onChange={(text, ev, num) => setCount(num ?? 0)}
onConfirm={() => saveSettings()}
/>

Label()

function Label(props: LabelProps): ReactElement<{
styles: Partial<Omit<LabelStyle, LuaStyleInternalKeys>>;
anchor?: GuiAnchor;
caption?: LocalisedString;
drag_target?: FrameGuiElement;
elem_tooltip?: ElemID;
enabled?: boolean;
game_controller_interaction?: game_controller_interaction;
ignored_by_interaction?: boolean;
index?: number;
location?: any;
locked?: boolean;
name?: string;
raise_hover_events?: boolean;
tooltip?: LocalisedString;
visible?: boolean;
ref?: Ref<any>;
children?: | ReactNode
| ReactNode[];
style?: any;
onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "label">) => void;
onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "label">) => void;
onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "label">) => void;
onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "label">) => void;
onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "label">) => void;
}, any>;

Defined in: react-components/Label.tsx:30

Factorio label component with built-in shortcuts for bold, large, multiline, and rich text.

Parameters

ParameterType
propsLabelProps

Returns

ReactElement<{ styles: Partial<Omit<LabelStyle, LuaStyleInternalKeys>>; anchor?: GuiAnchor; caption?: LocalisedString; drag_target?: FrameGuiElement; elem_tooltip?: ElemID; enabled?: boolean; game_controller_interaction?: game_controller_interaction; ignored_by_interaction?: boolean; index?: number; location?: any; locked?: boolean; name?: string; raise_hover_events?: boolean; tooltip?: LocalisedString; visible?: boolean; ref?: Ref<any>; children?: | ReactNode | ReactNode[]; style?: any; onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "label">) => void; onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "label">) => void; onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "label">) => void; onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "label">) => void; onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "label">) => void; }, any>

Example

<Label
caption="Section Title"
bold={true}
styles={{ font_color: { r: 1, g: 0.9, b: 0.7 } }}
/>

Labeled()

function Labeled(props: LabeledProps): any;

Defined in: react-components/Labeled.tsx:28

Horizontal form row layout containing a left-aligned label and right-aligned control separated by an expandable spacer.

Parameters

ParameterType
propsLabeledProps

Returns

any

Example

<Labeled caption="Station Priority">
<Input numeric={true} text={priority} onChange={setPriority} />
</Labeled>

Line()

function Line(props: LineProps): ReactElement<LineProps, any>;

Defined in: react-components/Line.tsx:16

Visual separator line (horizontal or vertical).

Parameters

ParameterType
propsLineProps

Returns

ReactElement<LineProps, any>

Example

<Line direction="horizontal" />

Listbox()

function Listbox(props: ListboxProps): ReactElement<ListboxProps, any>;

Defined in: react-components/Listbox.tsx:20

Native Factorio list-box component.

Parameters

ParameterType
propsListboxProps

Returns

ReactElement<ListboxProps, any>

Example

<Listbox
items={["Station Alpha", "Station Beta", "Station Gamma"]}
selected_index={selectedIndex}
onSelectionStateChanged={(ev) => setSelectedIndex(ev.element.selected_index)}
/>

Minimap()

function Minimap(props: MinimapProps): ReactElement<MinimapProps, any>;

Defined in: react-components/Minimap.tsx:11

Minimap view element.

Parameters

ParameterType
propsMinimapProps

Returns

ReactElement<MinimapProps, any>


PinButton()

function PinButton(props: PinButtonProps): any;

Defined in: react-components/PinButton.tsx:24

Window pin button for titlebars. Automatically toggles between white/black pin icons and manages pinned state.

Parameters

ParameterType
propsPinButtonProps

Returns

any

Example

<PinButton pinned={isPinned} onTogglePin={(next) => setIsPinned(next)} />

ProgressBar()

function ProgressBar(props: ProgressBarProps): ReactElement<ProgressBarProps, any>;

Defined in: react-components/ProgressBar.tsx:16

Native Factorio progress bar component.

Parameters

ParameterType
propsProgressBarProps

Returns

ReactElement<ProgressBarProps, any>

Example

<ProgressBar value={progressRatio} style="production_progressbar" />

RadioButton()

function RadioButton(props: RadioButtonProps): ReactElement<RadioButtonProps, any>;

Defined in: react-components/RadioButton.tsx:20

Native Factorio radio button component.

Parameters

ParameterType
propsRadioButtonProps

Returns

ReactElement<RadioButtonProps, any>

Example

<RadioButton
caption="Option 1"
state={selectedOption === 1}
onCheckedStateChanged={(ev) => ev.element.state && setSelectedOption(1)}
/>

RadioButtons()

function RadioButtons<T>(props: RadioButtonsProps<T>): any;

Defined in: react-components/RadioButtons.tsx:49

Grouped single-selection radio button list.

Type Parameters

Type Parameter
T

Parameters

ParameterType
propsRadioButtonsProps<T>

Returns

any

Example

<RadioButtons
value={selectedMode}
buttons={[
{ key: "counts", caption: "Counts Mode" },
{ key: "stacks", caption: "Stacks Mode" },
]}
onChange={(mode) => setSelectedMode(mode)}
/>

ScrollPane()

function ScrollPane(props: ScrollPaneProps): ReactElement<{
style: any;
anchor?: GuiAnchor;
caption?: LocalisedString;
elem_tooltip?: ElemID;
enabled?: boolean;
game_controller_interaction?: game_controller_interaction;
horizontal_scroll_policy?: ScrollPolicy;
ignored_by_interaction?: boolean;
index?: number;
location?: any;
locked?: boolean;
name?: string;
raise_hover_events?: boolean;
read_only?: boolean;
selectable?: boolean;
tooltip?: LocalisedString;
vertical_scroll_policy?: ScrollPolicy;
visible?: boolean;
word_wrap?: boolean;
ref?: Ref<any>;
children?: | ReactNode
| ReactNode[];
styles?: StylesFor<E>;
onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "scroll-pane">) => void;
onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "scroll-pane">) => void;
onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "scroll-pane">) => void;
onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "scroll-pane">) => void;
onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "scroll-pane">) => void;
}, any>;

Defined in: react-components/ScrollPane.tsx:24

Native Factorio scroll pane container. Supports scroll_pane, naked_scroll_pane, and deep_slots_scroll_pane styles.

Parameters

ParameterType
propsScrollPaneProps

Returns

ReactElement<{ style: any; anchor?: GuiAnchor; caption?: LocalisedString; elem_tooltip?: ElemID; enabled?: boolean; game_controller_interaction?: game_controller_interaction; horizontal_scroll_policy?: ScrollPolicy; ignored_by_interaction?: boolean; index?: number; location?: any; locked?: boolean; name?: string; raise_hover_events?: boolean; read_only?: boolean; selectable?: boolean; tooltip?: LocalisedString; vertical_scroll_policy?: ScrollPolicy; visible?: boolean; word_wrap?: boolean; ref?: Ref<any>; children?: | ReactNode | ReactNode[]; styles?: StylesFor<E>; onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "scroll-pane">) => void; onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "scroll-pane">) => void; onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "scroll-pane">) => void; onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "scroll-pane">) => void; onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "scroll-pane">) => void; }, any>

Example

<ScrollPane
style="naked_scroll_pane"
vertical_scroll_policy="auto"
horizontal_scroll_policy="never"
styles={{ maximal_height: 300, horizontally_stretchable: true }}
>
<VFlow>{items}</VFlow>
</ScrollPane>

getAllGlobalGroups()

function getAllGlobalGroups(): string[];

Defined in: react-components/SectionGroup.tsx:19

Retrieves all unique logistic group names across forces in the game using the native Factorio API (LuaForce::get_logistic_groups).

Returns

string[]


SectionGroup()

function SectionGroup(props: SectionGroupProps): any;

Defined in: react-components/SectionGroup.tsx:107

Logistic/Combinator section group component. Features an active toggle checkbox, in-line name editing with autofocus, global logistic group presets dropdown, delete button, and a customizable slot grid.

Parameters

ParameterType
propsSectionGroupProps

Returns

any

Example

<SectionGroup
name="Fuel Supply"
active={true}
slotCount={10}
columnCount={10}
slots={groupSlots}
onActiveChange={(active) => setGroupActive(active)}
onNameChange={(name) => setGroupName(name)}
onSlotChange={(slotIdx, sig) => updateSlot(slotIdx, sig)}
/>

ShallowSection()

function ShallowSection(props: FrameProps): any;

Defined in: react-components/ShallowSection.tsx:22

Padded sub-panel styled with inside_shallow_frame_with_padding. Ideal for grouping sub-controls or dialog panels within a main window frame.

Parameters

ParameterType
propsFrameProps

Returns

any

Example

<ShallowSection>
<Label caption="Network Settings" bold={true} />
<Input text={networkMask} onChange={setNetworkMask} />
</ShallowSection>

Slider()

function Slider(props: SliderProps): ReactElement<{
value: number;
slider_value: number;
onValueChanged: (ev: OnGuiValueChangedEvent) => void;
anchor?: GuiAnchor;
caption?: LocalisedString;
discrete_values?: boolean;
elem_tooltip?: ElemID;
enabled?: boolean;
game_controller_interaction?: game_controller_interaction;
ignored_by_interaction?: boolean;
index?: number;
location?: any;
locked?: boolean;
maximum_value?: number;
minimum_value?: number;
name?: string;
raise_hover_events?: boolean;
tooltip?: LocalisedString;
value_step?: number;
visible?: boolean;
ref?: Ref<any>;
children?: | ReactNode
| ReactNode[];
styles?: StylesFor<E>;
style?: any;
onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "slider">) => void;
onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "slider">) => void;
onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "slider">) => void;
onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "slider">) => void;
onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "slider">) => void;
}, any>;

Defined in: react-components/Slider.tsx:33

Native Factorio slider control with ergonomic onChange(value) callback.

Parameters

ParameterType
propsSliderProps

Returns

ReactElement<{ value: number; slider_value: number; onValueChanged: (ev: OnGuiValueChangedEvent) => void; anchor?: GuiAnchor; caption?: LocalisedString; discrete_values?: boolean; elem_tooltip?: ElemID; enabled?: boolean; game_controller_interaction?: game_controller_interaction; ignored_by_interaction?: boolean; index?: number; location?: any; locked?: boolean; maximum_value?: number; minimum_value?: number; name?: string; raise_hover_events?: boolean; tooltip?: LocalisedString; value_step?: number; visible?: boolean; ref?: Ref<any>; children?: | ReactNode | ReactNode[]; styles?: StylesFor<E>; style?: any; onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "slider">) => void; onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "slider">) => void; onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "slider">) => void; onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "slider">) => void; onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "slider">) => void; }, any>

Example

<Slider
minimum_value={0}
maximum_value={100}
value={volume}
debounceTicks={15}
onChange={(val) => setVolume(val)}
/>

SlotButton()

function SlotButton(props: SlotButtonProps): ReactElement<{
elem_type: string;
elem_value: any;
locked: boolean;
elem_filters: PrototypeFilterWrite;
style: any;
onClick: (this: void, event: TypedEvent<OnGuiClickEvent, "choose-elem-button">) => void & (this: void, ev: OnGuiClickEvent) => void;
onElemChanged: (ev: OnGuiElemChangedEvent) => void;
achievement?: string;
anchor?: GuiAnchor;
asteroid-chunk?: string;
caption?: LocalisedString;
decorative?: string;
elem_tooltip?: ElemID;
enabled?: boolean;
entity?: string;
entity-with-quality?: PrototypeWithQuality;
equipment?: string;
equipment-with-quality?: PrototypeWithQuality;
fluid?: string;
game_controller_interaction?: game_controller_interaction;
ignored_by_interaction?: boolean;
index?: number;
item?: string;
item-group?: string;
item-with-quality?: PrototypeWithQuality;
location?: any;
name?: string;
raise_hover_events?: boolean;
recipe?: string;
recipe-with-quality?: PrototypeWithQuality;
space-location?: string;
technology?: string;
tile?: string;
tooltip?: LocalisedString;
visible?: boolean;
ref?: Ref<any>;
children?: | ReactNode
| ReactNode[];
styles?: StylesFor<E>;
onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "choose-elem-button">) => void;
onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "choose-elem-button">) => void;
onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "choose-elem-button">) => void;
onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "choose-elem-button">) => void;
onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "choose-elem-button">) => void;
}, any>;

Defined in: react-components/SlotButton.tsx:69

Standard Factorio slot button with optional count and secondary/upper badges.

Parameters

ParameterType
propsSlotButtonProps

Returns

ReactElement<{ elem_type: string; elem_value: any; locked: boolean; elem_filters: PrototypeFilterWrite; style: any; onClick: (this: void, event: TypedEvent<OnGuiClickEvent, "choose-elem-button">) => void & (this: void, ev: OnGuiClickEvent) => void; onElemChanged: (ev: OnGuiElemChangedEvent) => void; achievement?: string; anchor?: GuiAnchor; asteroid-chunk?: string; caption?: LocalisedString; decorative?: string; elem_tooltip?: ElemID; enabled?: boolean; entity?: string; entity-with-quality?: PrototypeWithQuality; equipment?: string; equipment-with-quality?: PrototypeWithQuality; fluid?: string; game_controller_interaction?: game_controller_interaction; ignored_by_interaction?: boolean; index?: number; item?: string; item-group?: string; item-with-quality?: PrototypeWithQuality; location?: any; name?: string; raise_hover_events?: boolean; recipe?: string; recipe-with-quality?: PrototypeWithQuality; space-location?: string; technology?: string; tile?: string; tooltip?: LocalisedString; visible?: boolean; ref?: Ref<any>; children?: | ReactNode | ReactNode[]; styles?: StylesFor<E>; onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "choose-elem-button">) => void; onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "choose-elem-button">) => void; onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "choose-elem-button">) => void; onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "choose-elem-button">) => void; onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "choose-elem-button">) => void; }, any>

Example

<SlotButton
signal={activeSignal}
count={1500}
selected={isSelected}
onChange={(sig) => setActiveSignal(sig)}
/>

SlotButtonTable()

function SlotButtonTable(props: TableProps): any;

Defined in: react-components/SlotButtonTable.tsx:19

Table grid layout specifically styled for holding SlotButton items.

Parameters

ParameterType
propsTableProps

Returns

any

Example

<SlotButtonTable column_count={10} style="slot_table">
{slotButtons}
</SlotButtonTable>

Sprite()

function Sprite(props: SpriteProps): ReactElement<SpriteProps, any>;

Defined in: react-components/Sprite.tsx:16

Static sprite/icon display element.

Parameters

ParameterType
propsSpriteProps

Returns

ReactElement<SpriteProps, any>

Example

<Sprite sprite="item/iron-plate" />

SpriteButton()

function SpriteButton(props: SpriteButtonProps): ReactElement<SpriteButtonProps, any>;

Defined in: react-components/SpriteButton.tsx:21

Native Factorio sprite button component.

Parameters

ParameterType
propsSpriteButtonProps

Returns

ReactElement<SpriteButtonProps, any>

Example

<SpriteButton
sprite="utility/trash"
style="tool_button_red"
tooltip="Delete entry"
onClick={handleDelete}
/>

Switch()

function Switch(props: SwitchProps): ReactElement<{
switch_state: any;
onSwitchStateChanged: (ev: OnGuiSwitchStateChangedEvent) => void;
allow_none_state?: boolean;
anchor?: GuiAnchor;
caption?: LocalisedString;
elem_tooltip?: ElemID;
enabled?: boolean;
game_controller_interaction?: game_controller_interaction;
ignored_by_interaction?: boolean;
index?: number;
left_label_caption?: LocalisedString;
left_label_tooltip?: LocalisedString;
location?: any;
locked?: boolean;
name?: string;
raise_hover_events?: boolean;
right_label_caption?: LocalisedString;
right_label_tooltip?: LocalisedString;
tooltip?: LocalisedString;
visible?: boolean;
ref?: Ref<any>;
children?: | ReactNode
| ReactNode[];
styles?: StylesFor<E>;
style?: any;
onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "switch">) => void;
onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "switch">) => void;
onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "switch">) => void;
onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "switch">) => void;
onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "switch">) => void;
}, any>;

Defined in: react-components/Switch.tsx:31

Native Factorio 2-way or 3-way toggle switch component. Supports convenient boolean and numeric value mappings.

Parameters

ParameterType
propsSwitchProps

Returns

ReactElement<{ switch_state: any; onSwitchStateChanged: (ev: OnGuiSwitchStateChangedEvent) => void; allow_none_state?: boolean; anchor?: GuiAnchor; caption?: LocalisedString; elem_tooltip?: ElemID; enabled?: boolean; game_controller_interaction?: game_controller_interaction; ignored_by_interaction?: boolean; index?: number; left_label_caption?: LocalisedString; left_label_tooltip?: LocalisedString; location?: any; locked?: boolean; name?: string; raise_hover_events?: boolean; right_label_caption?: LocalisedString; right_label_tooltip?: LocalisedString; tooltip?: LocalisedString; visible?: boolean; ref?: Ref<any>; children?: | ReactNode | ReactNode[]; styles?: StylesFor<E>; style?: any; onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "switch">) => void; onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "switch">) => void; onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "switch">) => void; onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "switch">) => void; onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "switch">) => void; }, any>

Example

<Switch
value={isEnabled}
left_label_caption="OFF"
right_label_caption="ON"
onChange={(state) => setIsEnabled(state === "right")}
/>

Tab()

function Tab(props: TabProps): ReactNode;

Defined in: react-components/Tab.tsx:27

Declarative Tab specification component used inside <TabbedPane>. Content is lazily rendered only when the tab is currently active.

Parameters

ParameterType
propsTabProps

Returns

ReactNode

Example

<Tab caption="Configuration" badge_text="3">
<ConfigPanel />
</Tab>

TabbedPane()

function TabbedPane(props: TabbedPaneProps): any;

Defined in: react-components/TabbedPane.tsx:46

Native Factorio tabbed pane layout with lazy tab content mounting. Automatically builds header tab buttons and renders the active <Tab> content inside an inner frame.

Parameters

ParameterType
propsTabbedPaneProps

Returns

any

Example

<TabbedPane default_tab_index={1}>
<Tab caption="General">
<GeneralSettings />
</Tab>
<Tab caption="Advanced">
<AdvancedSettings />
</Tab>
</TabbedPane>

Table()

function Table(props: TableProps): ReactElement<TableProps, any>;

Defined in: react-components/Table.tsx:19

Grid layout table container (column_count determines the number of columns).

Parameters

ParameterType
propsTableProps

Returns

ReactElement<TableProps, any>

Example

<Table column_count={4}>
<SlotButton slot={1} />
<SlotButton slot={2} />
</Table>

Titlebar()

function Titlebar(props: TitlebarProps): any;

Defined in: react-components/Titlebar.tsx:45

Standard Factorio window titlebar header. Features title label with frame_title style, draggable handle area, custom action buttons, and a close button.

Parameters

ParameterType
propsTitlebarProps

Returns

any

Example

<Titlebar
caption="Combinator GUI"
drag_target={frameRef.current}
onClose={() => setOpened(false)}
/>

VFlow()

function VFlow(props: VFlowProps): ReactElement<{
direction: string;
anchor?: GuiAnchor;
caption?: LocalisedString;
drag_target?: FrameGuiElement;
elem_tooltip?: ElemID;
enabled?: boolean;
game_controller_interaction?: game_controller_interaction;
ignored_by_interaction?: boolean;
index?: number;
location?: any;
locked?: boolean;
name?: string;
raise_hover_events?: boolean;
tooltip?: LocalisedString;
visible?: boolean;
ref?: Ref<any>;
children?: | ReactNode
| ReactNode[];
styles?: StylesFor<E>;
style?: any;
onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "flow">) => void;
onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "flow">) => void;
onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "flow">) => void;
onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "flow">) => void;
onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "flow">) => void;
}, any>;

Defined in: react-components/VFlow.tsx:19

Vertical layout flow container (direction="vertical").

Parameters

ParameterType
propsVFlowProps

Returns

ReactElement<{ direction: string; anchor?: GuiAnchor; caption?: LocalisedString; drag_target?: FrameGuiElement; elem_tooltip?: ElemID; enabled?: boolean; game_controller_interaction?: game_controller_interaction; ignored_by_interaction?: boolean; index?: number; location?: any; locked?: boolean; name?: string; raise_hover_events?: boolean; tooltip?: LocalisedString; visible?: boolean; ref?: Ref<any>; children?: | ReactNode | ReactNode[]; styles?: StylesFor<E>; style?: any; onClosed?: (this: void, event: TypedEvent<OnGuiClosedEvent, "flow">) => void; onHover?: (this: void, event: TypedEvent<OnGuiHoverEvent, "flow">) => void; onLeave?: (this: void, event: TypedEvent<OnGuiLeaveEvent, "flow">) => void; onLocationChanged?: (this: void, event: TypedEvent<OnGuiLocationChangedEvent, "flow">) => void; onOpened?: (this: void, event: TypedEvent<OnGuiOpenedEvent, "flow">) => void; }, any>

Example

<VFlow styles={{ horizontally_stretchable: true }}>
<Label caption="Title" style="bold_label" />
<Label caption="Description text..." />
</VFlow>

WellFold()

function WellFold(props: WellFoldProps): any;

Defined in: react-components/WellFold.tsx:26

Collapsible well section with an expand/collapse toggle button in the header.

Parameters

ParameterType
propsWellFoldProps

Returns

any

Example

<WellFold caption="Advanced Options" defaultCollapsed={true}>
<Label caption="Detailed settings..." />
</WellFold>

WellHeader()

function WellHeader(props: WellHeaderProps): any;

Defined in: react-components/WellHeader.tsx:24

Subheader bar styled with subheader_frame and subheader_caption_label.

Parameters

ParameterType
propsWellHeaderProps

Returns

any

Example

<WellHeader caption="Section Title">
<Button caption="Actions" style="mini_button" />
</WellHeader>

WellSection()

function WellSection(props: WellSectionProps): any;

Defined in: react-components/WellSection.tsx:30

Grouped content section with a styled subheader bar and padded body flow.

Parameters

ParameterType
propsWellSectionProps

Returns

any

Example

<WellSection caption="Signal Filters">
<SlotButtonTable column_count={5}>{slots}</SlotButtonTable>
</WellSection>

WindowFrame()

function WindowFrame(props: WindowFrameProps): any;

Defined in: react-components/WindowFrame.tsx:68

Standard Factorio draggable window frame. Integrates useWindow for automatic position memory across sessions, pinning behavior, auto-centering, and titlebar controls.

Parameters

ParameterType
propsWindowFrameProps

Returns

any

Example

<WindowFrame
caption="My Mod Window"
playerIndex={playerIndex}
pinnable={true}
styles={{ width: 440 }}
onClose={() => setOpened(false)}
>
<TabbedPane>...</TabbedPane>
</WindowFrame>