Loading
Docs / Components / Searchboxes
v1.0.0 JAVA MOD LIBRARY

Searchboxes

Sunken search input with a leading magnifying glass icon, horizontal scrolling, and invalid state support.

ui.searchBox(...) shares the sunken #313233 frame, caret, selection, and clipboard behavior of ui.textBox(...), adding a leading OreIcon.SEARCH magnifying glass icon at x + 7 (20px inset before text). Unlike textBox, disabling a searchBox halves text and icon opacity on the dark surface (#313233) rather than switching to a light grey disabled fill.

Interactive Preview

OreTextbox
OreSearchBox

Method Signatures (OreUi)

// Default 31 px height (OreUi.FIELD_HEIGHT)
public void searchBox(int x, int y, int w, OreTextField field, String placeholder, boolean enabled)

// Custom height
public void searchBox(int x, int y, int w, int h, OreTextField field, String placeholder, boolean enabled)

// With invalid error state
public void searchBox(int x, int y, int w, int h, OreTextField field,
                      String placeholder, boolean enabled, boolean invalid)

Parameters

ParameterTypeDescription
x, y, w, hintBox coordinates and dimensions (h defaults to OreUi.FIELD_HEIGHT = 31).
fieldOreTextFieldPersistent field state storing search query and caret/selection state.
placeholderStringMuted hint text shown when field.value() is empty.
enabledbooleanWhen false, dims text and magnifying glass icon to 50% opacity.
invalidbooleanApplies invalid error tint when true.

Example

private final OreTextField searchField = new OreTextField();

// Inside extractView / extractContent:
ui.searchBox(x, y, 220, searchField, "Search packs...", true);
String query = searchField.value().trim().toLowerCase();