Skip to content
Tech News
← Back to articles

Show HN: Base-GPUI: A GPUI port of Base UI headless components

read original more articles
Why This Matters

Base GPUI brings the powerful, headless component API of Base UI to the GPUI environment, enabling developers to create highly customizable and accessible UI components in native applications. This development enhances the flexibility and control for both developers and users, fostering more dynamic and accessible interfaces across platforms. As an actively evolving project, it signals ongoing innovation in native UI component design within the Rust ecosystem.

Key Takeaways

Base GPUI A GPUI-native port of Base UI's rich, headless component APIs.

Base GPUI ports Base UI's rich component API surface to GPUI: compound parts, controlled and uncontrolled state, keyboard interaction, state-aware styling, and accessibility semantics. Components are unstyled, so applications retain complete control over their visual design.

The public API follows Base UI where its concepts map cleanly to native applications, while the implementation is designed specifically for GPUI's immediate-mode rendering model.

Important Base GPUI is under active development. APIs may change before version 1.0. Install it from GitHub, as is common for projects using GPUI's actively developed Git revision.

Installation

[ dependencies ] base-gpui = { git = " https://github.com/LukeTandjung/base-gpui " } gpui = { git = " https://github.com/zed-industries/zed " , rev = " 1d029c5ff5654fb1b1e8caf4462993c8ee13a133 " }

Usage

Initialize Base GPUI when your application starts:

use gpui :: { App , Application } ; fn main ( ) { Application :: new ( ) . run ( | cx : & mut App | { base_gpui :: init ( cx ) ; // Open your application window. } ) ; }

Components expose compound parts and state-aware styling. For example, tabs are composed from TabsRoot , TabsList , TabsTab , TabsIndicator , and TabsPanel rather than a single pre-styled widget.

... continue reading