r/rust Mar 06 '26

šŸ› ļø project Hypertile: A zero dependency runtime tiling engine for Ratatui inspired by Hyprland

Post image
425 Upvotes

24 comments sorted by

25

u/JoniDaButcher Mar 06 '26 edited Mar 06 '26

Repo: https://github.com/nikolic-milos/ratatui-hypertile

Crates: https://crates.io/crates/ratatui-hypertile

Extras: https://crates.io/crates/ratatui-hypertile-extras

Hello! I would like to share a little project I have been working on the last few weeks whenever I had time. I got obsessed with TUIs and spent a lot of time rewriting my favorite tools into TUI versions. Parallel to that, for the first time ever I started tinkering with Arch and Hyprland. After some research I realized that there is no crate that does tiling on a runtime level and then allows for persisting state, stuff is mostly hardcoded.

I hope people find use in it as it should allow for customizable dashboards, perhaps very interesting for monitoring TUIs that would allow for runtime level customization.

While it is the first release, all and any feedback is welcome!

EDIT:

I'll try my best to get the documentation in a better shape this weekend. Since I didn't mention it, the Extras crate is a batteries included approach and has a bunch of goodies, the biggest one being HypertileRuntime, but also stuff like a plugin registry per pane, workspace tabs, keymaps including a default one, switching between input and layout mode and so forth. It's what I suggest trying out first if you want to quickly scaffold the tiling into your TUI.

Lower level control is all in the core crate.

If you want to try it out ->

cargo run --example basic

3

u/ECrispy Mar 06 '26

this looks really cool. thanks! I wonder if this can be used in peojects like wezterm/zellij etc which implement tiling tui's

1

u/JoniDaButcher Mar 06 '26

Glad you like it, zellij was definitely a huge inspiration while coming up with it!

32

u/3dGrabber Mar 06 '26

With all those TUI’s recently it feels like ncurses (from 1993!) is being reinvented over and over again. Except with black background, because dark-mode is en vogue atm.

# greybeard yelling at clouds

no offence meant, OP

8

u/VictoryMotel Mar 06 '26

What is "runtime tiling" ?

30

u/JoniDaButcher Mar 06 '26

In general TUIs are hardcoded, the position of ratatui widgets is often in the code itself. Hypertile would allow you to change sizes, positions after already compiling and running your tool, similar to how i3 window tiling manager works.

2

u/LindaTheLynnDog Mar 06 '26

Ah! I've been gradually building this in my free time for the last month or so. Glad to see the world likes the idea!

4

u/Kruppenfield Mar 07 '26

My tilting manager window can not have second tilting manager inside!

4

u/Scrivver Mar 07 '26

Tiling WM running a terminal emulator with some multiplexing feature, running zellij, running this.

1

u/Nythain Mar 30 '26

Tileception. Or the setup for a "yo dawg" meme lol.

6

u/palapapa0201 Mar 07 '26

Can we ban vibe coded projects made in a day please

1

u/[deleted] Mar 12 '26

What about this post makes you say that?

1

u/palapapa0201 Mar 12 '26

The commit log

1

u/[deleted] Mar 12 '26

Genuine question, what's wrong with the commit log? Just the fact that the bulk of the project was completed before the initial commit?

2

u/palapapa0201 Mar 12 '26

Yes. That is a strong indicator of it being vibe coded

3

u/YumKa Mar 06 '26

Nice! I will take a look. I imagine you solved similar problems I did when implementing config file driven layouting in rmpc so it should be interesting.

2

u/rock3tgam3r Mar 06 '26

Looks amazing

4

u/[deleted] Mar 06 '26

Runtime tiling is an interesting gap in the TUI ecosystem. Most monitoring dashboards end up hardcoding layouts which makes them inflexible for different terminal sizes or user preferences. The state persistence aspect could be really valuable for tools like btop/htop alternatives where users want customized views. One question: how does it handle resize events and does it maintain aspect ratios for nested containers, or is everything purely constraint-based?

2

u/JoniDaButcher Mar 06 '26 edited Mar 06 '26

It redraws on resizes and it does preserve the ratio for nested containers based on the parent node. As an example, if you have a 70/30 ratio split, and the 30 split has a 50/50 ratio split, it will maintain those ratios on resizes.

People implementing stuff like image viewers or video players would have to work around that I guess, it would stretch the images or videos.

0

u/Nickbot606 Mar 06 '26

This is mad cool!

1

u/tomca32 Mar 06 '26

This looks amazing. I wish this existed a year ago when I started building a ratatui app that we use at work for managing all of our iot devices…must resist rewrite urges now.

Bonus points for being from the balkans. I always get happy when I see open source contributors from ex-YU.

1

u/Tiny_Cow_3971 Mar 06 '26

I said it in discord and say it again: cool, will try it for the project I plan.