{"id":15074323,"url":"https://github.com/nicopap/cuicui","last_synced_at":"2025-08-11T15:06:24.098Z","repository":{"id":155055805,"uuid":"597774262","full_name":"nicopap/cuicui","owner":"nicopap","description":"3rd party crates to handle bevy UI","archived":false,"fork":false,"pushed_at":"2023-06-21T09:50:24.000Z","size":1146,"stargazers_count":26,"open_issues_count":14,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-12T04:39:47.965Z","etag":null,"topics":["bevy","cuicui","framework","rich-text","rust","ui"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nicopap.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"licenses/LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-05T15:52:08.000Z","updated_at":"2025-07-04T19:49:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"c1e1daf4-56f5-4bcf-9c29-d859bb3570cf","html_url":"https://github.com/nicopap/cuicui","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/nicopap/cuicui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicopap%2Fcuicui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicopap%2Fcuicui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicopap%2Fcuicui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicopap%2Fcuicui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicopap","download_url":"https://codeload.github.com/nicopap/cuicui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicopap%2Fcuicui/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269907344,"owners_count":24494343,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bevy","cuicui","framework","rich-text","rust","ui"],"created_at":"2024-09-25T03:32:08.318Z","updated_at":"2025-08-11T15:06:24.022Z","avatar_url":"https://github.com/nicopap.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cuicui framework\n\n| ❗ **THIS IS A WIP, MOST FEATURES ARE NOT IMPLEMENTED YET, SEE TODO** ❗ |\n|--------------------------------------------------------------------------|\n\nA mad experiment in making a principled UI that integrates with bevy.\n\n## Why?\n\n- A very simple layout algorithm you can keep in your head.\n- Reuses the same rendering as 2d, the final game binary will be smaller.\n- You can directly manipulate UI element's `Transform`.\n- Better integration with 3rd party crates, as it uses pre-existing 2d primitives.\n  - You want to add particles? [Go ahead][bevy_hanabi].\n  - You want UI element outlines? [Go ahead][bevy_2d_outline].\n  - May be interested in the beta branch of [`bevy_mod_picking`]\n- cuicui is built on top of a composable `Modify` system, acting like prefabs/blueprints.\n- There is a few widgets I ABSOLUTELY NEED for my game, and `bevy_ui` has\n  nothing more than buttons (yikes!!)\n- Oh god I expected this list to only have two items\n\n## Crates\n\nCuicui is a collection of crates.\n\n- `cuicui_widges`: The innexisting collection of widgets\n- `cuicui_layout`: A dumb layouting algorithm you can emulate in your head.\n  It provides clear error messages when you do something stupid (instead of\n  itself doing something stupid)\n- `cuicui_datazoo`: A collection of bit-tweedling datastructures for `cuicui_fab`.\n- `cuicui_fab_derive`: the `impl_modify` macro for `cuicui_fab`\n- `cuicui_fab`: A tree of modifiers that can act on a sequence of items.\n  Implementing static value culling and data dependency management.\n  (this is very abstract, but useful for `cuicui_richtext`)\n- `cuicui_fab_parse`: A parser to generate a modifier tree from a format string\n- `cuicui_reflect_query`: A bevy `Reflect` trait to query entities and `\u0026dyn Reflect`\n  directly from the world.\n- `cuicui_bevy_fab`: An adapter to plug `cuicui_fab` into bevy. This defines\n  not only how `Resolver` fits in bevy's ECS, but also how to hooks into the ECS\n  to read values declared in the format string\n- `cuicui_richtext`: A rich text component for bevy\n- `cuicui_bevy_layout_offset`: A small bevy plugin to manipulate UI element transform\n\n\n### History\n\nIt first started as an alternative UI library for bevy, I didn't vibe with\nflexbox, so I invented my own layouting algorithm. I got this far.\nThen I wanted to design a UI system based on hot reloading, inspired by the\nwork I did on [Klod].\n\nI got stuck in endless design parallysis. Then I went and did other things\n(including implementing parallax mapping and morph targets in bevy).\n\nThe 25th of April 2023, I started designing a rich text component for bevy.\n\nLittle did I know I would spent the next 2 months working on this at full time.\n\nI had in mind a syntax to cleanly declare text styling and maybe eventually\ngeneralize it to more UI components, so I decided to make it live in this\nrepository. \"Maybe eventually generalize\" is the number one cause of developper\ndisapearance in the XXIst century. This was a prime example of overengineering.\n\nIt quickly got out of hand. I initially \"just wanted\" an abstraction over the\nbevy `Text` and its section so that I could set a value by name rather than\npainstakingly declare each section independently then index the right one.\n\nBut feature creep creeped into the feature list.\n\n* Now I wanted to nest sections into other ones.\n* Let's reimplement this using [`nom`], wait I can't understand the errors, let's use\n  [`winnow`] instead! Much better!\n* What about this cool effect in paper mario where the text is rainbow? How to\n  split the text in smaller sections?\n* Hmm, I'd like to access and format directly values from any field in the ECS\n  (yes, this is possible with `bevy_reflect`)\n* Dang I love the embossed effect of [`bevy_ui_bits`](bui_bits), I need a way to\n  manipulate whole text components rather than just sections.\n* Wait? This look like I'm reimplementing React. Does this mean I should step back?\n  Noooo, of course! Let's make it a UI library.\n\nWell, regardless of how we ended up here, we are definitively here, and as far\nas I know, there is no going back. Is it wishable? Maybe, I mean, I still don't\nhave a useable rich text component, and in perspective I've still a couple months\nwork in front of me before I do.\n\n### Dependency tree\n\n```mermaid\nflowchart LR\n  datazoo[\"datazoo\"]\n  fab_derive[\"fab_derive\"]\n  fab[\"fab\"]\n  fab_parse[\"fab_parse\"]\n  reflect_query[\"reflect_query\"]\n  bevy_fab[\"bevy_fab\"]\n  richtext[\"richtext\"]\n  bevy_layout_offset[\"bevy_layout_offset\"]\n  datazoo --\u003e fab\n  fab_derive --\u003e fab\n  fab --\u003e fab_parse \u0026 bevy_fab\n  reflect_query --\u003e bevy_fab\n  fab_parse --\u003e bevy_fab \u0026 richtext\n  bevy_fab --\u003e richtext\n  bevy_layout_offset--\u003e|\"cresustext\"|richtext\n```\n\n## Reflect Query\n\nBevy lacks a way to _query_ for reflected `Component`s.\nWithout this ability, you would be stuck _iterating over all `EntityRef` and\nchecking if it contains the component in question_.\n\n`reflect_query` defines `ReflectQueryable`, a way to query for a given component\nfrom the world.\n\nSee [`cuicui_reflect_query`'s README](./reflect_query)\n\n\n## Widges\n\ncuicui defines a bunch of widges **NOT**.\n\nSee [`cuicui_widges`'s README for the list of innexisting widges](./widges)\n\n## Layout\n\ncuicui defines its own layouting algorithm.\n\nSee [`cuicui_layout`'s README](./layout).\n\n## Fab\n\nA Reactive programming framework with no state management.\n\nSince we are building on bevy, there is absolutely no point in reinventing\nstate mangement in our UI framework. For all intent and purposes, bevy's `World`\nis where the state is at.\n\nSee [`cuicui_fab`'s README](./fab).\n\n## Rich text\n\ncuicui defines a `RichText` component.\n\nSee [`cuicui_richtext`'s README](./richtext).\n\n## Short term roadmap\n\n0. [X] Fix panic on modifier parsing in richtext\n0. [X] Enable usage with `Reflect` resources\n1. [ ] Publish richtext\n1. [X] Implement change detection\n2. [X] Study documentation, best way of presenting the crate\n3. [ ] Advertise to bevy community richtext and potential for `Modify` trait\n4. [X] Abstract `Modify`, Create a `cuicui_fab` crate, dedicated to `Modify`.\n5. [ ] Study bevy_proto, how could the `Modify` trait be integrated?\n6. [ ] Go back to cuicui_layout, shortcomings, usage limitations\n7. [ ] Improve cuicui_layout based on that.\n8. [ ] Publish layout\n9. [ ] Document cuicui_layout (same as step 2 but for cuicui_layout)\n10. [ ] 2nd round of cuicui_layout advertisement in bevy community\n11. [ ] Abstract cuicui_layout over storage (ie: support `slotmap`), split crate\n        in two `cuicui_bevy_layout` \u0026 `cuicui_layout`.\n12. [ ] Contribute a cuicui_layout adapter to taffy.\n\nOther plans:\n\n- Integrate `bevy-ui-navigation`.\n- Integrate `bevy_mod_picking` once beta branch is mainlined.\n\n\n## License\n\nCopyright © 2023 Nicola Papale\n\nThis software is licensed under either MIT or Apache 2.0 at your leisure.\nSee `licenses` directory for details.\n\n[bevy_2d_outline]: https://lib.rs/crates/bevy_simple_2d_outline\n[bevy_hanabi]: https://lib.rs/crates/bevy_hanabi\n[`bevy_mod_picking`]: https://lib.rs/crates/bevy_mod_picking\n[`slotmap`]: https://lib.rs/crates/slotmap\n[`taffy`]: https://lib.rs/crates/taffy\n[`bevy-inspector-egui`]: https://lib.rs/crates/bevy-inspector-egui\n[`bevy-ui-navigation`]: https://lib.rs/crates/bevy-ui-navigation\n[Klod]: https://gibonus.itch.io/the-boneklod\n[bui_bits]: https://github.com/septum/bevy_ui_bits\n[`nom`]: https://lib.rs/crates/nom\n[`winnow`]: https://lib.rs/crates/winnow\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicopap%2Fcuicui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicopap%2Fcuicui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicopap%2Fcuicui/lists"}