gpui-component/README.md
Jason Lee 7ceae0acff
Revert "dock: Revert AnyView cached (#607)" (#611)
This reverts commit 2479fc3418.

> NOTE: When we enabled this, we need make sure call `cx.nofity()` when
the data has been updated.

In real world application, this may reduce about 3% CPU cost.

<img width="550" alt="image"
src="https://github.com/user-attachments/assets/9188cde9-3402-4860-9e03-328aa74a74e7"
/>

> I watched this data about 5 minutes, the CPU cost is always like this.
2025-02-10 14:09:09 +08:00

2.4 KiB

GPUI Component

This is still an early stage of development, we may change API frequently. But the features is ok to use, you must keep tracking our changes.

UI components for building fantastic desktop application by using GPUI.

Features

  • Theming
  • TitleBar
  • Dock, Tiles
  • TextInput, TextArea, OtpInput
  • Button, Link
  • Label
  • Icon
  • Checkbox, Radio, Switch
  • Dropdown
  • Tabs
  • Notification
  • Tooltip
  • Popover
  • Resizable
  • Progress & Indicator
  • Slider
  • Skeleton
  • DatePicker, DateRangePicker, Calendar
  • ColorPicker
  • List
  • Table
  • Menu
  • Drawer
  • Modal
  • WebView
  • Accordion
  • Sidebar
  • Breadcrumb
  • Badge

Showcase

Here is the first application: Longbridge that is built by using GPUI Component.

It still under development, not published yet.

SCR-20250107-kagq SCR-20250107-kaky SCR-20250107-kapd SCR-20250107-kfvk

We build multi-themes support in application, this feature is not including in GPUI Component. It is based on Theme feature, so it easy to do.

Usage

GPUI and GPUI Component still in development, so we need add dependency by git.

And GPUI Component depends on gpui by special version (It keep updated to upstream) for including WebView support.

gpui = { git = "https://github.com/huacnlee/zed.git", branch = "export-platform-window" }
gpui-component = { git = "https://github.com/longbridge/gpui-component.git" }

More usage can be found in story directory.

Demo

If you want to see the demo, here is a some demo applications.

Development

cargo run

More examples can be found in examples directory.

Checkout DEVELOPMENT to see more details.

License

Apache-2.0