GPUI Deck

Architecture

How the rendering runtime, headless behavior and application presentation layers divide the work.

LayerImplementation and originResponsibility
Rendering and application runtimeZed's GPUI, consumed through the pinned gpui-pre snapshot packagesWindows, layout, drawing, text, events, entities, and focus infrastructure
Headless behaviorThis repository's gpui-deck crate, extracted from Longbridge's gpui-base 0.9.0Control state, interaction contracts, focus policy, and accessibility semantics
Presentation and compositionApplication code, including the copyable examples/recipes modules used by two_stylesColors, sizes, icons, component arrangement, and application actions

crates/base is the directory name inherited from GPUI Kit. Its Cargo package is now gpui-deck; the selected source is maintained here. The original gpui-base README already described an unstyled behavior foundation. GPUI Deck builds on that work with a narrower public surface and independently maintained state and focus contracts. Upstream source changes are reviewed and adopted explicitly.

gpui-pre publishes version-aligned snapshots of Zed's GPUI. The pinned 0.3.12 package records Zed revision d2a4fb6ded7c470be25d1541281da3882495b65b.

The controls listed above belong to the behavior layer. Compound controls reuse that layer: Toggle and Collapsible triggers compose Button, ToggleGroup composes Toggle, and AlertDialog composes Dialog. DropdownMenu and ContextMenu share MenuState, MenuItem, MenuOption, and MenuEvent. Their common menu behavior composes Popover; only the trigger interaction and requested placement differ. MenuOption::checked(bool), check_state(CheckboxState) and radio_checked(bool) project application-owned state into native menu semantics. MenuSubmenu routes leaf activation through the root MenuState; it does not add another selection store. Command reuses Input for its query and can be hosted in Dialog. Combobox reuses Command's filtering, result cursor, scrolling, and activation, with single or multiple committed values and a suggestion surface positioned by Popup. Textarea renders the existing multiline editing state. Field projects associated text into that native input's semantics. Label uses the target's existing FocusHandle for click-to-focus; the pinned GPUI API does not expose a native labelled-by relationship between the sibling elements. Tooltip reuses Button and GPUI's native tooltip layer while retaining hover/focus visibility. HoverCard combines Button with Popup positioning and a retained hover/focus lifecycle without taking focus from the trigger. Calendar composes Button for day activation and uses jiff's civil date type for Gregorian arithmetic. DatePicker coordinates that Calendar with Popover's focus and dismissal lifecycle; it has no duplicate date value or popup engine. Resizable uses GPUI flex layout and native dragging for retained multi-panel groups. Table uses shared GPUI column tracks and native table semantics. ScrollArea composes GPUI's ScrollHandle viewport with the retained Scrollbar implementation, without another scrolling engine. Breadcrumb supplies native navigation/list structure and current-page metadata; the consumer composes ordinary Buttons and owns their destination callbacks. Appearance belongs in the application. The local gpui-deck-cli copies selected presentation recipes and their dependencies into consumer-owned modules. A remote registry and separately published styled component package are not provided.

See the form control guide for state ownership, keyboard contracts, and application-owned styling. Checkbox and Switch report the next value through a callback; the application stores it and notifies its view. RadioGroup retains selection and option focus in an entity, accepts fixed ordered options with unique values, and changes selection immediately on arrow navigation.

The navigation and overlay guide covers Breadcrumb, Tabs, Accordion, Collapsible, Popover, DropdownMenu, ContextMenu, Command, Tooltip, HoverCard, and AlertDialog. Inactive panels do not contribute layout, focus, or accessibility nodes. Popover reuses the existing popup positioning primitive and lets keyboard focus leave its contents within the enclosing window or dialog. Both menu triggers use that lifecycle and close before dispatching a command, so a command can open another surface without losing its new focus. The layout and data guide explains shared Table columns, ScrollArea composition, Resizable panes, and their current limits.