{"id":30714249,"url":"https://github.com/mikbry/ui","last_synced_at":"2026-02-11T23:41:33.734Z","repository":{"id":310480334,"uuid":"1040012118","full_name":"mikbry/ui","owner":"mikbry","description":"A modern, cross-platform UI toolkit for Rust, C++ and Python. Inspired by shadcn/ui, React Native and NativeWind.","archived":false,"fork":false,"pushed_at":"2025-08-27T16:49:46.000Z","size":80,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-03T04:44:00.701Z","etag":null,"topics":["cpp","pyo3","python","react","react-native","shadcn-ui","tailwindcss"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikbry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-18T10:23:19.000Z","updated_at":"2025-08-27T16:51:32.000Z","dependencies_parsed_at":"2025-09-03T04:43:49.190Z","dependency_job_id":null,"html_url":"https://github.com/mikbry/ui","commit_stats":null,"previous_names":["mikbry/ui"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mikbry/ui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikbry%2Fui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikbry%2Fui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikbry%2Fui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikbry%2Fui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikbry","download_url":"https://codeload.github.com/mikbry/ui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikbry%2Fui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29349640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T20:11:40.865Z","status":"ssl_error","status_checked_at":"2026-02-11T20:10:41.637Z","response_time":97,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cpp","pyo3","python","react","react-native","shadcn-ui","tailwindcss"],"created_at":"2025-09-03T04:43:46.598Z","updated_at":"2026-02-11T23:41:33.729Z","avatar_url":"https://github.com/mikbry.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# miklabs/ui\n\n*A modern, cross-platform UI toolkit for Rust, C, C++ \u0026 Python. Inspired by [shadcn/ui](https://ui.shadcn.com), [React Native](https://reactnative.dev), and [NativeWind](https://www.nativewind.dev).*\n\n✨ Declarative • 🎨 Tailwind-style utilities • 🖼 Themeable • 🌍 Cross-platform • 🔧 Multi-language • ⚖️ MIT/Apache\n\n---\n\n## 🚀 Quick Example\n\n### Rust\n\n```rust\nuse showcase_common::create_showcase_ui;\n\nfn main() -\u003e std::io::Result\u003c()\u003e {\n    // Create and run a cross-platform UI\n    mkui::run!(create_showcase_ui, console)\n}\n```\n\nOr build it step by step:\n\n```rust\nuse mkui::prelude::*;\n\nfn main() -\u003e Result\u003c(), MkuiError\u003e {\n    let app = Mkui::new()?\n        .child(\n            View::new()\n                .class(\"flex-1 items-center justify-center\")\n                .child(Text::new(\"Hello World!\").class(\"text-xl font-bold\"))\n                .child(\n                    Button::new(\"Press me\")\n                        .variant(ButtonVariant::Primary)\n                        .on_press(|| println!(\"Button pressed!\"))\n                )\n        );\n    \n    app.run()\n}\n```\n\n### C++\n\n```cpp\n#include \"mkui.hpp\"\n\nint main() {\n    try {\n        auto app = mkui::createApp();\n        \n        app-\u003eaddView(\"flex-1 items-center justify-center\")\n           .addText(\"Hello World!\", \"text-xl font-bold\")\n           .addButton(\"Press me\", mkui::ButtonVariant::Primary)\n           .runConsole();\n           \n    } catch (const mkui::MkuiException\u0026 e) {\n        std::cerr \u003c\u003c \"Error: \" \u003c\u003c e.what() \u003c\u003c std::endl;\n        return 1;\n    }\n    return 0;\n}\n```\n\n### C\n\n```c\n#include \"mkui_c.h\"\n\nint main() {\n    MkuiApp* app = mkui_app_new();\n    if (!app) return 1;\n    \n    mkui_app_add_view(app, \"flex-1 items-center justify-center\");\n    mkui_app_add_text(app, \"Hello World!\", \"text-xl font-bold\");\n    mkui_app_add_button(app, \"Press me\", \"\", MKUI_BUTTON_PRIMARY);\n    \n    MkuiResult result = mkui_app_run_console(app);\n    mkui_app_free(app);\n    \n    return result.code == MKUI_SUCCESS ? 0 : 1;\n}\n```\n\n### Python\n\n```python\nimport mkui_py\n\ndef main():\n    try:\n        # Create application using the high-level API\n        app = mkui_py.create_app()\n        \n        # Build UI using method chaining\n        (app.view(\"flex-1 items-center justify-center\")\n            .text(\"Hello World!\", \"text-xl font-bold\")\n            .button(\"Press me\", mkui_py.BUTTON_PRIMARY)\n            .run_console())\n            \n    except Exception as e:\n        print(f\"Error: {e}\")\n        return 1\n    return 0\n\nif __name__ == \"__main__\":\n    exit(main())\n```\n\n---\n\n## 🎨 Styling with Utility Classes\n\nmiklabs/ui uses a **Tailwind-like utility system** for layout, spacing, colors, and typography.\n\nExamples:\n\n* `flex-1`, `items-center`, `justify-between`\n* `p-4`, `mt-2`, `gap-3`\n* `rounded-lg`, `bg-surface`, `text-primary`\n\nVariants work like shadcn’s **cva**:\n\n```yaml\nbutton:\n  base: \"inline-flex items-center justify-center rounded-lg transition\"\n  variants:\n    intent:\n      primary: \"bg-primary text-primary-foreground hover:bg-primary/80\"\n      outline: \"border border-input hover:bg-muted\"\n    size:\n      sm: \"h-8 px-3 text-sm\"\n      md: \"h-10 px-4 text-base\"\n      lg: \"h-12 px-6 text-lg\"\n  default:\n    intent: \"primary\"\n    size: \"md\"\n```\n\n---\n\n## 🌍 Target Platforms \u0026 Languages\n\n### Platforms\n* **Desktop**: Windows, macOS, Linux ✅\n* **Console**: Terminal UIs with crossterm ✅\n* **Web**: via WebAssembly ✅\n* **Mobile**: iOS, iPadOS, Android 🚧 (planned)\n* **Embedded**: WGPU on Vulkan/GL ES devices 🚧 (planned)\n\n### Language Support\n* **Rust**: Native support with full API ✅\n* **C**: Complete FFI bindings with manual memory management ✅\n* **C++**: Modern C++17 wrapper with RAII and exceptions ✅\n* **Python**: PyO3 bindings with method chaining and exception handling ✅\n* **JavaScript/TypeScript**: WASM bindings 🚧 (planned)\n\n---\n\n## 📊 Comparison\n\n### Qt\n\n```cpp\nQApplication app(argc, argv);\nQWidget window;\nQPushButton *button = new QPushButton(\"Click me\", \u0026window);\nQObject::connect(button, \u0026QPushButton::clicked, []() { qDebug() \u003c\u003c \"Clicked!\"; });\nwindow.show();\nreturn app.exec();\n```\n\n### miklabs/ui\n\n```cpp\n#include \"mkui.hpp\"\n\nint main() {\n    try {\n        auto app = mkui::createApp();\n        app-\u003eaddButton(\"Click me\", mkui::ButtonVariant::Primary, \"px-4 py-2 rounded-lg\")\n           .runConsole();\n    } catch (const mkui::MkuiException\u0026 e) {\n        std::cout \u003c\u003c \"Clicked!\\n\";\n    }\n}\n```\n\n✅ Fewer lines, declarative, and styled with utilities.\n\n---\n\n## 🎮 Try the Showcases\n\nExperience miklabs/ui across different platforms and languages:\n\n### Rust Showcases\n\n**Console Showcase** - Terminal UI with crossterm\n```bash\ncargo run --bin console-showcase\n# Navigate: ↑↓←→  |  Interact: Space/Enter  |  Quit: q/Esc\n```\n\n**Web Showcase** - WebAssembly in browser\n```bash\ncd examples/web-showcase\nwasm-pack build --target web\n# Serve the generated files with any static server\n```\n\n**Headless Showcase** - Pure logic without rendering\n```bash\ncargo run --bin headless-showcase\n```\n\n### C/C++ Examples\n\n**C Example** - Manual memory management\n```bash\ncd examples/c-example\nmake run\n```\n\n**C++ Example** - Modern RAII with exceptions\n```bash\ncd examples/cpp-example  \nmake run\n```\n\n### Python Example\n\n**Python Example** - PyO3 bindings with exception handling\n```bash\ncd examples/python-example\n\n# Build the Python bindings first\ncd ../../crates/mkui-py\nuv venv \u0026\u0026 source .venv/bin/activate\nmaturin develop --release\n\n# Run the Python example\ncd ../../examples/python-example\npython main.py\n```\n\n### Key Features Demonstrated\n\n- ✅ **Unified API**: Same UI code works across console, web, and native\n- ✅ **Error Handling**: Proper error propagation with platform-specific types\n- ✅ **Memory Safety**: Automatic cleanup in Rust/C++, manual in C\n- ✅ **Styling**: Tailwind-like utility classes work everywhere\n- ✅ **Components**: Views, Text, Buttons with multiple variants\n\n---\n\n## 🔮 Roadmap\n\n### ✅ Phase 1: Foundation (COMPLETED)\n* ✅ **Multi-language Support** - Rust, C, C++, and Python APIs with unified interface\n* ✅ **Cross-platform Core** - Abstract error handling and component system  \n* ✅ **Builder API** - Fluent builder pattern with method chaining\n* ✅ **Bridge Architecture** - Unified `mkui` crate with feature-based platform switching\n* ✅ **Headless Components** - Platform-agnostic logic (state, variants, events)\n  * ✅ Button component with 6 variants and state management\n  * ✅ Text component with styling and content management  \n  * ✅ View component for layout and containers\n* ✅ **Console Renderer** - Terminal UI with crossterm (no ratatui dependency)\n* ✅ **Web Renderer** - DOM-based with WebAssembly support\n* ✅ **C/C++ Bindings** - Complete FFI layer with modern C++17 wrapper\n* ✅ **Python Bindings** - PyO3-based bindings with method chaining and exception handling\n* ✅ **Showcases** - Working examples across all supported languages and platforms\n* ✅ **Memory Management** - RAII for C++/Rust, manual cleanup for C\n* ✅ **Error Handling** - Unified abstract errors with platform-specific conversion\n* ✅ **Macro System** - `mkui::run!` macro for platform-agnostic application execution\n\n### 🚧 Phase 2: Advanced Features (IN PROGRESS)\n* [ ] **RSX Macro** - JSX-like syntax for declarative UI construction\n* [ ] **Layout Engine** - Flexbox/CSS Grid-like layout with Taffy integration\n* [ ] **Advanced Components** - Input fields, Select, Dialog, Popover, Menu\n* [ ] **Accessibility** - Screen reader support, keyboard navigation, ARIA attributes  \n* [ ] **Theme System** - Live theme switching, custom color palettes\n* [ ] **Hot Reload** - Development-time live reloading for rapid iteration\n* [ ] **Testing Framework** - Component testing utilities and assertions\n\n### 🔮 Phase 3: Platform Expansion (PLANNED)  \n* [ ] **Native Desktop** - WGPU backend for Windows, macOS, Linux\n* [ ] **Mobile Support** - iOS and Android with platform-specific integrations\n* [ ] **Language Bindings** - JavaScript/TypeScript (WASM), Go (CGO)\n* [ ] **IDE Integration** - Language servers, syntax highlighting, code completion\n* [ ] **Component Marketplace** - Shared component ecosystem and package manager\n* [ ] **Production Tools** - Profiling, debugging, performance analysis\n\n### 🎯 Current Focus (v0.2.0)\n1. **RSX Syntax** - Investigate proc macro for JSX-like syntax\n2. **Layout Engine** - Integrate Taffy for cross-platform layout\n3. **Component Library** - Expand beyond basic View/Text/Button  \n4. **Documentation** - Comprehensive guides and API references\n5. **Testing** - Unit tests, integration tests, example validation\n\n---\n\n## 💬 Community\n\n* Website: [miklabs.com/ui](https://miklabs.com/ui) (coming soon)\n* GitHub Discussions: [github.com/miklabs/ui/discussions](https://github.com/miklabs/ui/discussions)\n* Discord: *coming soon*\n\n---\n\n## ⚖️ License\n\nMIT or Apache 2.0 (permissive, no GPL headaches).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikbry%2Fui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikbry%2Fui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikbry%2Fui/lists"}