Loading
Docs / Components / Tab Bars
v1.0.0 JAVA MOD LIBRARY

Tab Bars

Pinned 27px top screen header bar using Minecraft Ten typography and leading/trailing icon buttons.

ui.tabBar(...) draws the 27px tall (OreUi.TAB_HEIGHT) light stone header strip (#D0D1D5 face with #B1B2B6 2px bottom shadow), centering a Minecraft Ten (OreFont.TEN, 1.35F scale) title with optional 27×27 leading and trailing icon buttons (ui.tabButton). OrePanelScreen renders this bar across the top of the screen automatically unless disabled via .titleBar(false).

PLAY
SETTINGS
MARKETPLACE
WORLDS

Anatomy & Layout

  • Typography: Renders title in OreFont.TEN at 1.35F scale in dark charcoal (OreTone.TEXT_DARK).
  • Surface: #D0D1D5 (OreTone.TAB_FACE) paired with a 2px #B1B2B6 (OreTone.TAB_SHADOW) bottom ledge.
  • Docked buttons: Passing leading or trailing 8×8 icons automatically places icon-only tabButton triggers flush at the left and right ends of the bar.

Method Signatures (OreUi & OrePanelScreen)

// Bare 27 px tab bar strip
public void tabBar(int x, int y, int w)

// Full tab bar with centered Minecraft Ten title and optional left/right icon buttons (returns 27)
public int tabBar(int x, int y, int w, String title,
                  String[] leading, Runnable onLeading,
                  String[] trailing, Runnable onTrailing)

In OrePanelScreen:

titleBar(boolean on)
barTitle(String text)
barButtons(String[] leading, Runnable onLeadingAction, String[] trailing, Runnable onTrailingAction)

Parameters

ParameterTypeDescription
x, y, wintTop-left GUI pixel coordinates and bar width (height is OreUi.TAB_HEIGHT = 27).
titleStringCentered screen title rendered in OreFont.TEN (null omits title).
leading, onLeadingString[], RunnableOptional left 8×8 icon (OreIcon.CHEVRON_LEFT.small) and click callback.
trailing, onTrailingString[], RunnableOptional right 8×8 icon (OreIcon.CLOSE.small) and click callback.

Example

// Standalone OreScreen usage
int barH = ui.tabBar(0, 0, this.width, "Settings",
	OreIcon.CHEVRON_LEFT.small, this::onClose,
	OreIcon.QUESTION_MARK.small, this::openHelp);

// Or configure in OrePanelScreen constructor
barTitle("Settings")
	.barButtons(OreIcon.CHEVRON_LEFT.small, this::onClose, OreIcon.CLOSE.small, this::onClose);