Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/The-Young-Maker/OpenMenuOS/llms.txt

Use this file to discover all available pages before exploring further.

OpenMenuOS ships with sensible visual defaults and two named style presets, but every aspect of the menu’s appearance — colors, scrollbar shape, fonts, and motion — can be customized through the OpenMenuOS configuration methods. All style changes must be applied before calling menu.begin() so they take effect on the first render.

Style presets

The fastest way to apply a cohesive look is with useStylePreset(). Two presets are available by name or number:
NameNumberDescription
"Default"0Classic monochrome theme
"Rabbit_R1"1Modern blue-accent theme
// Apply by name
menu.useStylePreset("Rabbit_R1");
menu.useStylePreset("Default");

// Apply by number (same result)
menu.useStylePreset(1);  // Rabbit_R1
menu.useStylePreset(0);  // Default
Presets set a bundle of ScreenConfig values at once — colors, menu style, scrollbar style, and more. Individual calls made after useStylePreset() override only the specific fields you specify.
setMenuStyle() controls how the selection rectangle is drawn around the active item.
menu.setMenuStyle(0);  // Outlined — border only, transparent fill
menu.setMenuStyle(1);  // Filled — solid background behind the selected item (default)

Selection colors

The selection rectangle consists of two independently colored layers: the border and the fill. Both use 16-bit RGB565 color values, compatible with all TFT_eSPI color constants.
menu.setSelectionBorderColor(TFT_WHITE);      // default
menu.setSelectionFillColor(TFT_BLACK);        // default

// Example: cyan border, dark grey fill
menu.setSelectionBorderColor(TFT_CYAN);
menu.setSelectionFillColor(TFT_DARKGREY);
The ScreenConfig defaults are:
uint16_t selectionBorderColor = TFT_WHITE;
uint16_t selectionFillColor   = TFT_BLACK;
uint16_t selectedItemColor    = TFT_WHITE;  // text color of selected item

Scrollbar

The scrollbar appears on the right edge of the screen when there are more items than fit in the visible area.
menu.setScrollbar(true);            // show scrollbar (default: true)
menu.setScrollbar(false);           // hide scrollbar

menu.setScrollbarStyle(0);          // Default style
menu.setScrollbarStyle(1);          // Modern style (default in ScreenConfig)

menu.setScrollbarColor(TFT_WHITE);  // scrollbar color (default: TFT_WHITE)
ScreenConfig defaults:
bool     scrollbar      = true;
int      scrollbarStyle = 1;
uint16_t scrollbarColor = TFT_WHITE;

Fonts

You can replace the built-in bitmap font with any GFXfont-compatible font (Adafruit GFX format). Two slots are available: a regular weight and a bold weight.
#include <Fonts/FreeMono9pt7b.h>
#include <Fonts/FreeMonoBold9pt7b.h>

menu.setMenuFont(&FreeMono9pt7b);
menu.setMenuFontBold(&FreeMonoBold9pt7b);
Pass nullptr to revert to the default built-in font:
menu.setMenuFont(nullptr);

Animations

Three independent animation toggles let you trade visual polish for performance, which is particularly useful on lower-powered ESP8266 boards.
menu.setAnimation(true);           // smooth scroll and transition animations (default: true)
menu.setButtonAnimation(true);     // visual feedback on button press (default: true)
menu.setTextScroll(true);          // horizontal scrolling for long item labels (default: true)
ScreenConfig defaults:
bool animation        = true;
bool buttonAnimation  = true;
bool textScroll       = true;
Disabling setTextScroll(false) gives a noticeable performance improvement when many items have long labels, since each scroll cycle requires multiple redraws.

ScreenConfig struct reference

All styling state is stored in a shared ScreenConfig struct, accessible via Screen::config. The defaults applied at startup are:
struct ScreenConfig {
    // Colors (RGB565)
    uint16_t scrollbarColor       = TFT_WHITE;
    uint16_t selectionBorderColor = TFT_WHITE;
    uint16_t selectionFillColor   = TFT_BLACK;
    uint16_t selectedItemColor    = TFT_WHITE;

    // Feature toggles
    bool scrollbar       = true;
    bool buttonAnimation = true;
    bool textScroll      = true;
    bool showImages      = false;
    bool animation       = true;

    // Style selectors
    int menuStyle     = 1;   // 0 = outlined, 1 = filled
    int scrollbarStyle = 1;  // 0 = default, 1 = modern
    int textShift     = -4;  // vertical text offset in pixels
};
Do not modify ScreenConfig directly in production code. Use the OpenMenuOS setter methods so changes are applied consistently and any internal state that depends on them is updated correctly.

Putting it all together

#include "OpenMenuOS.h"

OpenMenuOS menu;
MenuScreen mainMenu("Main Menu");

void setup() {
    mainMenu.addItem("Option A");
    mainMenu.addItem("Option B");
    mainMenu.addItem("Option C");

    // Start from the Rabbit_R1 preset, then tweak
    menu.useStylePreset("Rabbit_R1");

    menu.setMenuStyle(1);
    menu.setSelectionBorderColor(TFT_CYAN);
    menu.setSelectionFillColor(TFT_DARKGREY);

    menu.setScrollbar(true);
    menu.setScrollbarStyle(1);
    menu.setScrollbarColor(TFT_WHITE);

    menu.setAnimation(true);
    menu.setButtonAnimation(true);
    menu.setTextScroll(true);

    menu.begin(&mainMenu);
}

void loop() {
    menu.loop();
}

Build docs developers (and LLMs) love