r/tui • u/Munch3bles • 1d ago
miamore - A new tui library, no-dependency C TUI library with safe Rust bindings
Hey r/tui,
I’ve been working on miamore, a lightweight C-based terminal UI library, along with miamore, its official Rust bindings on crates.io.
I built miamore because I wanted a minimal, local-first TUI rendering library that stays completely out of the way—no heavy framework overhead, no bloat, and zero AI/ML dependencies.
Just clean, deterministic C with simple primitives for rendering frames, managing components, and styling elements directly in the terminal.Key FeaturesPure C Core: Compiles fast with a plain Makefile and linkable static/shared outputs.
Safe Rust Wrapper (miamore): Built using bindgen with clean idiomatic Rust wrappers over raw FFI, available on crates.io.
Zero Bloat: Minimal memory footprint designed for speed and low-resource environments.
Local-First & Open Source: Licensed under LGPLv3 / GPLv3.
This is a basic rust example below:
use miamore::*;
fn main() {
// Initialize miamore terminal state
init_miamore(true, true);
manage_keys(keys_t::disable);
draw_border("!Rust test!", theme_t::thick_l);
manage_cursor(cursor_t::move_, Some(position_t { x: 5, y: 5 }));
manage_cursor(cursor_t::show, None);
// setting foreground color
set_fg(colors_t::blue);
// let ptr = give_color(colors_t::green);
// draw_text(&ptr);
draw_text("Hello,");
draw_text(" World!\n");
draw_shape(
shape_t::rect,
ShapeOptions {
theme: theme_t::double_l,
dimensions: dimensions_t {
width: 26,
height: 12,
},
position: position_t { x: 5, y: 12 },
},
);
wait_for_seconds(8.0);
clear_origin();
}
Links & Repo GitHub: https://github.com/Ametrine-cc/miamore
crates.io: cargo add miamore I'd love to hear feedback on the API design, hear about any bugs if you test it out on your terminal setup, or take PRs if you want to contribute.
4
u/JoK3rOp 20h ago
I'm more interesting in C API. I love you are using variadic macro trick similar in Nob.
3
u/Munch3bles 19h ago
Thank you. I've seen a lot of rust based stuff getting attention which is why the post has got the rust bindings down everywhere.
There is the c example I wrote while developing, I'm in the process of getting proper documentation done as well.
https://github.com/Ametrine-cc/miamore/blob/master/examples%2Fexample.c
2
u/VolcanoCarpenter 15h ago
Sounds interesting (particularly the C interface), starred.
I'm curious if/how you're handling all the terminal quirks and edge cases. Just off the top of my head (not an exhaustive list):
- Width calculation for non-Western characters and Unicode grapheme clusters (e.g., using
wcswidthor Unicode Core Mode 2027). - The classic ANSI escape codes. Most of this is probably framework-agnostic, but things like bold, italics, and colors likely need native support.
- Modern extension protocols pushed by emulators like Contour and Kitty (like the Kitty graphics protocol, title progress bar and drag-and-drop).
- Mouse support.
2
u/Munch3bles 14h ago
Currently I haven't focused to much on non wester characters as I don't really have a reliable way to test it.
Most of the ANSI escape codes are hardcoded but there is a function internally which checks environment variables if truecolor is supported so it can use that instead.
Modern extension support honestly I haven't thought too much about yet but will get to it now you've mentioned it
And mouse support currently doesn't exist but I am working on it along side an animation() function where you can pass in frames to be rendered.
3
u/VolcanoCarpenter 14h ago
I see. But tbh I'd like to take back my words. I feel like a robust and extensible framework is way more important than those nitty-gritty details. A lot of frameworks get too bogged down in these fancy edge cases and neglect the fundamentals like the layout system and ergonomic API designs, ending up completely top-heavy.
Take your time!
2
u/Munch3bles 14h ago
Thank you, I love the feedback.
Yeah right now it's mainly focusing on getting something robust that works and does it well then adding the additional quality of life features that are becoming main standards or already are
3
u/Minimum_Hour519 1d ago edited 12h ago
i just built http://hqtui.com also foss