No description
Find a file
Jason Lee c98e4f0521
checkbox: Add children to Radio, Checkbox to display long texts. (#724)
This change is going to solve the wrapped text line-height.

Before this change, the Label is must set `line-height: 100%` to render
at same line with the checkbox.

But if there have a long text in label, wrapped lines need more
line-height to leave lines spaces. But if we set line-height over the
100%, that the checkbox will not align horizontal center.

So, this change to use other child to solve this issue, we can set
line-height to the child not to the label.


<img width="1204" alt="image"
src="https://github.com/user-attachments/assets/981cf925-01c7-48d7-9dd2-881c727a1759"
/>
2025-03-20 19:12:48 +08:00
.cargo windows: Set the default stack size to 8M on Windows. (#228) 2024-09-09 13:51:10 +08:00
.github ci: Temporarily skip machete (#663) 2025-02-25 15:13:54 +08:00
assets table: Improve sort icon color and fix stripe row display. (#578) 2025-01-26 16:25:34 +08:00
crates checkbox: Add children to Radio, Checkbox to display long texts. (#724) 2025-03-20 19:12:48 +08:00
script script: Fix install script on Ubuntu. (#366) 2024-10-18 23:14:55 +08:00
.gitignore chore: Upgrade GPUI 3 (#587) 2025-01-27 03:58:48 +08:00
Cargo.lock chore: Remove unused feature (#702) 2025-03-10 22:17:27 +08:00
Cargo.toml webview: Let webview as a feature and not default enable. (#648) 2025-02-24 14:24:22 +08:00
DEVELOPMENT tiles: Add Tiles (#435) 2024-12-16 20:33:14 +08:00
LICENSE-APACHE Update year of LICENSE-APACHE 2025-02-17 14:48:49 +08:00
README.md toggle: Add Toggle and ToggleGroup. (#691) 2025-03-06 19:10:28 +08:00

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
  • TextView (Markdown, Simple HTML) to native rendering, syntax highlighting.
  • Toggle, ToggleGroup

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 = "webview" }
gpui-component = { git = "https://github.com/longbridge/gpui-component.git" }

WebView

GPUI Component have WebView element based on Wry, this is an optional feature, you can enable it by feature flag.

gpui-component = { git = "https://github.com/longbridge/gpui-component.git", features = ["webview"] }

More usage can be found in story directory.

Icons

GPUI Component have Icon element, but it does not include SVG files by default.

The example is using Lucide icons, but you can use any icons you like, just named the svg files like IconName defined the path name. You can add icons that you need in your project.

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