A high-level UI helper library built on Adafruit_GFX for small monochrome displays.
s3ui provides ready-to-use screens for common UI patterns on small displays:
- Option Selection: Display a list of selectable options with cursor
- Editable Values: Options with right-aligned editable values
- Running Activity: Static or animated bitmap displays with captions
- Activity Log: Scrolling live activity log
- Confirmation Screen: Action confirmation with text, optional bitmap, and smart button layout
The library is designed to be non-blocking and works with any Adafruit_GFX-compatible display (e.g., PCF8814/Nokia 1100, SSD1306, etc.).
- Non-blocking animations and updates
- Works with any Adafruit_GFX-compatible display
- Customizable fonts and sizes
- Auto-scrolling log with word wrapping
- Smooth frame-based animations
- Automatic layout calculations
- Smart button layout (horizontal, 2+1, or vertical stack)
- Download this library as a ZIP file
- In Arduino IDE, go to Sketch → Include Library → Add .ZIP Library
- Select the downloaded ZIP file
- Restart Arduino IDE
Add to your platformio.ini:
lib_deps =
adafruit/Adafruit-GFX-Library
adafruit/Adafruit_BusIO
fpp3/s3ui- Adafruit GFX Library
- Adafruit BusIO
- A compatible display driver (e.g., PCF8814, Adafruit_SSD1306)
#include <s3ui.h>
#include <PCF8814.h>
PCF8814 display = PCF8814(/* your pins */);
s3ui ui;
void setup() {
display.begin();
ui.setDisplay(&display, 96, 65);
ui.setTitleFont(&Picopixel);
ui.setContentFont(&Picopixel);
ui.setTitleSize(1);
ui.setContentSize(1);
}
void loop() {
String options[] = {"Option 1", "Option 2", "Option 3"};
ui.optionSelectScreen("Menu", "100%", options, 3, 0);
display.display();
ui.update(); // Handle animations and updates
}setDisplay(Adafruit_GFX *display, uint16_t width, uint16_t height)- Set the display instancesetTitleFont(const GFXfont *font)- Set font for titlessetContentFont(const GFXfont *font)- Set font for contentsetTitleSize(uint8_t size)- Set title text sizesetContentSize(uint8_t size)- Set content text size
optionSelectScreen(...)- Display selectable optionsoptionValueSetScreen(...)- Display options with editable valuesrunningActivityScreen(...)- Display static or animated activityactivityLiveLogScreen(...)- Display scrolling logconfirmScreen(...)- Display confirmation dialog with optional bitmap
update()- Call in loop() to handle animations and log refresh
appendLogLine(const String &line)- Add a line to the logclearLog()- Clear all log linesgetLogLineCount()- Get number of stored lines
clear()- Clear entire displayclearContentBox()- Clear only content areagetGFX()- Access underlying graphics context
See the examples/ folder for complete working examples:
activityLiveLog_test- Live scrolling log demonstrationanimated_runningActivityScreen- Animated bitmap displayoptionSelect_test- Option selection menuoptionValueSet_test- Editable values interfacestatic_runningActivityScreen_test- Static activity displayconfirmScreen_test- Confirmation dialog with smart layout
See LICENSE file for details.
Contributions are welcome! Please feel free to submit pull requests or open issues.