With a `tree-sitter-languages` feature to enable it (Default not enable). Changed this for reduce the application size (From 52 MB to 22MB), Ref #1132 Now default only includes `tree-sitter-json`, if you want more: ```toml [dependencies] gpui-component = { features = ["tree-sitter-languages"] } ``` --- ``` cargo bloat -p hello_world --release -n 10 Finished `release` profile [optimized] target(s) in 0.27s Analyzing target/release/hello_world File .text Size Crate Name 0.4% 1.4% 88.5KiB simple_minify_html simple_minify_html::code_gen::attrs::ATTRS::{{closure}} 0.3% 1.0% 62.1KiB taffy taffy::compute::grid::track_sizing::resolve_intrinsic_track_sizes 0.1% 0.5% 32.6KiB gpui_component gpui_component::theme::theme_color::ThemeColor::dark 0.1% 0.5% 30.0KiB gpui_component gpui_component::theme::theme_color::ThemeColor::light 0.1% 0.5% 29.9KiB html5ever html5ever::tree_builder::TreeBuilder<Handle,Sink>::step 0.1% 0.4% 27.2KiB gpui taffy::compute::flexbox::compute_flexbox_layout 0.1% 0.4% 23.3KiB usvg usvg::text::layout::layout_text 0.1% 0.4% 22.5KiB resvg resvg::filter::apply_inner 0.1% 0.3% 21.4KiB gpui jpeg_decoder::decoder::Decoder<R>::decode_internal 0.1% 0.3% 21.2KiB image_webp image_webp::lossless::LosslessDecoder<R>::decode_image_stream 25.3% 94.3% 5.7MiB And 14091 smaller methods. Use -n N to show more. 26.8% 100.0% 6.0MiB .text section size, the file size is 22.4MiB ``` |
||
|---|---|---|
| .cargo | ||
| .github | ||
| assets | ||
| crates | ||
| script | ||
| themes | ||
| .gitignore | ||
| .theme-schema.json | ||
| Cargo.lock | ||
| Cargo.toml | ||
| DEVELOPMENT.md | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE-APACHE | ||
| README.md | ||
GPUI Component
UI components for building fantastic desktop applications using GPUI.
Features
- Richness: 40+ cross-platform desktop UI components.
- Native: Inspired by macOS and Windows controls, combined with shadcn/ui design for a modern experience.
- Ease of Use: Stateless
RenderOncecomponents, simple and user-friendly. - Customizable: Built-in
ThemeandThemeColor, supporting multi-theme and variable-based configurations. - Versatile: Supports sizes like
xs,sm,md, andlg. - Flexible Layout: Dock layout for panel arrangements, resizing, and freeform (Tiles) layouts.
- High Performance: Virtualized Table and List components for smooth large-data rendering.
- Content Rendering: Native support for Markdown and simple HTML.
- Charting: Built-in charts for visualization your data.
- Code Highlighting: Code Editor and Syntax highlighting.
- Wef: (Experimental) Offscreen rendering webview based on CEF.
Showcase
Here is the first application: Longbridge Pro, built using GPUI Component.
We built multi-theme support in the application. This feature is not included in GPUI Component itself, but is based on the Theme feature, so it's easy to implement.
Usage
GPUI and GPUI Component are still in development, so you need to add dependencies by git.
gpui = { git = "https://github.com/zed-industries/zed.git" }
gpui-component = { git = "https://github.com/longbridge/gpui-component.git" }
WebView
Still early and experimental; there are a lot of limitations.
GPUI Component has a WebView element based on Wry. This is an optional feature, which you can enable with a feature flag.
gpui-component = { git = "https://github.com/longbridge/gpui-component.git", features = ["webview"] }
More usage examples can be found in the story directory.
Icons
GPUI Component has an Icon element, but it does not include SVG files by default.
The example uses Lucide icons, but you can use any icons you like. Just name the SVG files as defined in IconName. You can add any icons you need to your project.
Development
We have a gallery of applications built with GPUI Component.
cargo run
More examples can be found in the examples directory. You can run them with cargo run --example <example_name>.
Check out DEVELOPMENT.md for more details.
License
Apache-2.0