A collection of components and widgets that are built for bevy_ui and the ECS pattern

Related tags

GUI bevy_ui_widgets
Overview

Widgets for Bevy UI

A collection of components and widgets that are built for bevy_ui and the ECS pattern.

Current State

This was started recently and is still under development. This is still just an experiment and it's unclear if and when a first release will be made available. I will be iterating over different API's and implementations to find what works and what doesn't.

Design Goals

  • Simple: Use thin abstractions over the ECS pattern
  • Modular: Features should be extensible, customizable and replaceable
  • Bevy-native: Build on top of existing Bevy features without a third-party UI library

Built for bevy_ui and ECS

The bevy_ui crate is lacking in some areas, but the main features required to create simple UIs are there. I noticed that most UI libraries for Bevy were actually bevy plugins that adapt third-party renderers, so I decided to start thinking about what was lacking to make building "Bevy-native" UIs simpler. This library attempts to fill some of those gaps only using thin abstractions over Bevy, with the idea that some of those abstractions could become good enough to be merged to bevy_ui at some point. This means that using this library in its actual state will only remove some of the UI boilerplate code, and not most of it.

Library Features

UI Components

This library provides multiple new components that can be used as building blocks to add behavior to UI nodes. These behaviors are implemented in systems that are provided by multiple different plugins, so that you can use only what you need. Following the data-oriented principles of ECS, those building blocks can be mixed and matched to compose UIs. This hopefully reduces the amount of systems that need to be written to implement basic functionalities compared to using raw bevy_ui.

Of course, some building blocks may not make sense together and may even "fight" each other. This is normal in a data-driven design and it's up to the documentation and to implementations to try to reduce the amount of problems this can cause to users of the library.

Widget Builders

In the current state of this library, a widget is really just a group of components and systems that expect a specific hierarchy structure and share the common goal of rendering something useful to the UI.

A widget builder is therefore really just a thin abstraction layer that helps you spawn the right hierarchy of entities expected for those components and systems to work properly. The widget builders provided by this library also offer convenient ways to interact with that creation, so that everything is 100% customizable.

Slider Widget Example

As an example, the SliderWidgetPlugin comes with a bunch of components and systems tailored to render an interactive slider with variable minimum, maximum and steps value. The SliderWidgetBuilder will spawn the following hierarchy of UI bundles:

|- Root: SliderBundle
   |- Track: NodeBundle + SliderTrackNode + RootEntity
   |- Thumb: NodeBundle + SliderThumbNode + RootEntity + Grab

Here, SliderBundle is a variation of NodeBundle with extra slider-specific components.

The builder also exposes methods that allow you to edit each bundle before it is spawned and allow you the run entity commands on each spawned entity individually so that you can add or remove components and even children. For example, you could edit the root's SliderBundle to customize the minimum, maximum and step values of the slider. You could then use Thumb entity commands to insert an InteractionCursorIcon component to show a "grab" cursor when hovered.

See the slider example for a concrete example of spawning a slider widget.

Widgets List

Frame

A frame is like a window that exists in the UI of your application. A frame has a title bar with a close button, and it can have any content inside of it. It can be moved around, resized, minimized and closed.

frame.mp4

Tooltip

A tooltip is a box that "floats" over other UI elements and contains some text.

Tooltips are useful to display additional information to users when they mouse-over or select something on the screen.

Tooltip

Slider

A slider allows to make selections from a range of values.

Slider

You might also like...
Unofficial Linux QQ client, based on GTK4 and libadwaita, developed with Rust and Relm4.
Unofficial Linux QQ client, based on GTK4 and libadwaita, developed with Rust and Relm4.

GTK QQ (WIP) Unofficial Linux QQ client, based on GTK4 and libadwaita, developed with Rust and Relm4. Screenshots Light Dark Note The two screenshots

Build beautiful desktop apps with flutter and rust. 🌠 (wip)
Build beautiful desktop apps with flutter and rust. 🌠 (wip)

flutter-rs Build flutter desktop app in dart & rust. Get Started Install requirements Rust flutter sdk Develop install the cargo flutter command cargo

Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.
Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.

libui: a portable GUI library for C This README is being written. Status It has come to my attention that I have not been particularly clear about how

Integrate Qml and Rust by building the QMetaObject at compile time.

QMetaObject crate for Rust The qmetaobject crate is a crate which is used to expose rust object to Qt and QML. Objectives Rust procedural macro (custo

OS-native file dialogs on Linux, OS X and Windows
OS-native file dialogs on Linux, OS X and Windows

nfd-rs nfd-rs is a Rust binding to the library nativefiledialog, that provides a convenient cross-platform interface to opening file dialogs on Linux,

Build smaller, faster, and more secure desktop applications with a web frontend.
Build smaller, faster, and more secure desktop applications with a web frontend.

TAURI Tauri Apps footprint: minuscule performance: ludicrous flexibility: gymnastic security: hardened Current Releases Component Descrip

File system enumerator and monitor for Android.

File system enumerator and file monitor for Android. Built to be compatible with other command line utilties! This tool was created to somewhat automa

A tiny, neat C library that portably invokes native file open and save dialogs.
A tiny, neat C library that portably invokes native file open and save dialogs.

Native File Dialog A tiny, neat C library that portably invokes native file open, folder select and save dialogs. Write dialog code once and have it p

SixtyFPS is a toolkit to efficiently develop fluid graphical user interfaces for any display: embedded devices and desktop applications. We support multiple programming languages, such as Rust, C++ or JavaScript.
SixtyFPS is a toolkit to efficiently develop fluid graphical user interfaces for any display: embedded devices and desktop applications. We support multiple programming languages, such as Rust, C++ or JavaScript.

SixtyFPS is a toolkit to efficiently develop fluid graphical user interfaces for any display: embedded devices and desktop applications. We support multiple programming languages, such as Rust, C++ or JavaScript.

Comments
  • Add GitHub pages site with examples

    Add GitHub pages site with examples

    Add a simple GitHub page for documentation purposes. Since this project is under development and not fully fleshed out, the first objective would at least be to have runnable examples to showcase the library's features.

    It can be a very simple mostly-static site, but ideally it should be kept up to date mostly automatically via GitHub Actions.

    documentation enhancement 
    opened by oceantume 0
Owner
Gabriel Bourgeois
Gabriel Bourgeois
Mod loader for Mega Man Battle Network Legacy Collection.

chaudloader chaudloader is a mod loader for Mega Man Battle Network Legacy Collection. For users Run install.exe. If you are on Steam Deck, you will n

The Rockman EXE Zone 6 Apr 23, 2023
Deno is a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust.

Deno Deno is a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust. Features Secure by default. No file,

Derek Jones 2 Aug 13, 2022
A powerful color picker and formatter, built with GTK and Rust

Eyedropper A powerful color picker and formatter. More screenshots Features Pick a Color Enter a color in Hex-Format Parse RGBA/ARGB Hex-Colors View c

Jonathan 108 Dec 24, 2022
A UI-framework, built for speed and ease-of-use

A UI-framework, built for speed and ease-of-use. Focused on one thing, the best user-experience for the client and developer.

Vacaro 46 Dec 6, 2022
A powerful desktop widget app for windows, built with Vue and Tauri.

DashboardX Widgets A powerful desktop widget app for windows, built with Vue and Tauri. Still in development Currently only runs on windows (uses nati

DashboardX Widgets 3 Oct 25, 2023
A simple UI framework for Rust built on top of IUP (http://webserver2.tecgraf.puc-rio.br/iup/)

KISS-UI A UI framework for Rust based on the KISS (Keep It Simple, Stupid!) philosophy. Powered by the IUP GUI library for C by Tecgraf, via the bindi

null 342 Jul 11, 2022
A simple news reading GUI app built in Rust

Headlines [WIP] A native GUI app built with Rust using egui. Uses newsapi.org as the source to fetch news articles. This is a WIP and the current stat

creativcoder 89 Dec 29, 2022
Rust bindings to Core Foundation and other low level libraries on Mac OS X and iOS

core-foundation-rs Compatibility Targets macOS 10.7 by default. To enable features added in macOS 10.8, set Cargo feature mac_os_10_8_features. To hav

Servo 685 Jan 2, 2023
Rust bindings and wrappers for GLib, GDK 3, GTK+ 3 and Cairo.

THIS REPOSITORY IS DEPRECATED SEE: https://github.com/rust-gnome rgtk Rust bindings and wrappers for GLib, GDK 3, GTK+ 3 and Cairo. Building rgtk expe

Jeremy Letang 124 Jul 10, 2022
A simple, clean, and beautiful WYSIWYG Markdown editor and content-management system

ScribeDown Current version: v0.0.1 Feature level: See the roadmap Beautiful, Clean, Writer-Oriented The goal of ScribeDown is to make Markdown the bes

Alex Dumas 4 Dec 20, 2022