GithubHelp home page GithubHelp logo

gold-silver-copper / egui_ratatui Goto Github PK

View Code? Open in Web Editor NEW
80.0 1.0 4.0 22.01 MB

A ratatui backend that is also an egui widget. Deploy on web with WASM or ship natively with bevy, macroquad, or eframe

Home Page: https://gold-silver-copper.github.io/

License: Apache License 2.0

JavaScript 2.46% Shell 16.09% Rust 81.45%
bevy egui gui ratatui rust tui wasm web

egui_ratatui's Introduction

egui_ratatui : egui widget + ratatui backend (WASM)

Crates.io Documentation License Downloads + Downloads

Discord: https://discord.gg/tDBPkdgApN https://discord.gg/tDBPkdgApN

See Bevy and Macroquad folders for game engine examples

Web Demo : https://gold-silver-copper.github.io/ (works best on firefox)

See also: https://ratatui.rs/ https://github.com/emilk/egui

RataguiBackend is the name of the backend/widget in code

cargo add egui_ratatui

git clone https://github.com/gold-silver-copper/egui_ratatui.git

cd egui_ratatui

cd bevy_example

cargo run

This repo provides the Ratagui Backend, which is also a Widget for egui. So you can have a whole ratatui terminal inside of egui. Also since egui is so WASM compatible, this means we can use this to compile ratatui to WASM !

If you would like more information about compiling to WASM please consult the relevant EGUI backend documentation:

Bevy: https://bevy-cheatbook.github.io/platforms/wasm.html

Macroquad: https://macroquad.rs/articles/wasm/

eframe: https://github.com/emilk/eframe_template

Previously this repo was called 'ratatatui_egui_wasm' and the crate was called 'ratframe' , I decided to rename it to egui_ratatui for clarity and discoverability , please see the PRE-RENAME branch for the last version of ratframe.

Warning: seems theres currently a weird bug with high DPI displays that can break the render a bit. This bug is also pushing me to remove the internal use of the Label widget for wrapping the text layout. Will do that soon enough.

egui_ratatui's People

Contributors

alexanderarodin avatar alexkazik avatar ashwinvin avatar austenadler avatar baretuna avatar bglw avatar c-git avatar coderedart avatar daninspace104 avatar elliottslaughter avatar emilk avatar gold-silver-copper avatar hoptimized avatar imaitland avatar james2022-rgb avatar jimskapt avatar mankinskin avatar markusdd avatar mingun avatar mrtanoshii avatar nhodgesvfx avatar norbert-sebok avatar patrickelectric avatar trappitsch avatar woelper avatar wumpf avatar xosxos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

egui_ratatui's Issues

Usage Tips

If I find ways that make using the library better, I will document them here. Later I will make a better source but this is it for now.

coexist with other controls in a window?

I wanted to use a textedit as a cli entry line, rather than deal with keyboard events and sending them to the terminal.

However the way egui_ratatui calculates the available size is based off the entire window ui; so if you add any additional controls to the window, then egui_ratatui continually resizes itself larger until it hits the edges of the screen.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.