Expand description
ui — SwiftUI-flavored components for gpui. Reached as bezel::ui.
Style flows through the environment, never through parameters: components
read theme::Theme (a gpui Global) at paint time, the way
SwiftUI views read @Environment. Motion comes from the named
motion catalog.
Re-exports§
pub use icons;
Modules§
- color
- Color picking: a preset
Swatchset the app configures, andColorPickerfor anything outside it. - combobox
Combobox— a select you can type into: the closed face of a select over an anchored menu whose rows narrow as you search.- context_
menu - A view’s menu: a right press on a text surface, a
···on a row, a+in a header. - control_
bar control_bar— the floating control bar: a glass surface holding a leading cluster, an optional centre, and a trailing cluster. Apple Music’s transport, a desktop agent app’s composer, a floating toolbar.- cover
- Where overlays sit in the frame being drawn, for native views over the window (a webview) that nothing gpui paints can cover.
- date
Calendar— a date picker: the closed face of a select over an anchored month grid.- docking
- Pane docking previews. Hosts own the layout and apply one accepted drop.
- drag
- Drag and drop reordering over gpui’s active drag.
- floating
panel— content that floats over a page and is dragged around it: a meter, an inspector, a detached preview.- focus
- Keyboard focus traversal —
tabandshift-tabbetween controls. - fonts
- The fonts an app paints with, for gpui’s text system and for SVG laid out and drawn with usvg.
- history
- Bounded snapshot storage. Callers decide which edits form a group.
- hover_
card HoverCard— the richer sibling ofcrate::tooltip::Tooltip: a card that opens on hover and can itself be hovered, for a preview the pointer can travel into (a profile, a link target, a definition).- input
TextField— a single-line text field with IME, selection and clipboard.- keys
- Reading the keymap back, so a printed accelerator is the one that fires.
- list
- Virtualized list — a thin binding over gpui’s
uniform_list, and a bridge that letscrate::scroll::scrollbarreport on one. - loaders
- Loaders: the orb cluster, the pulse loader and the gradient matrix spinners.
All motion routes through
motionpure helpers, so the math is unit-tested and these elements are testable-by-compile. - menu
Item— a row in a dropped menu — andcard, the panel that paints a list of them plus the panels itsItem::Submenurows drop.- menubar
Menubar— the in-window bar: a strip of titles that drop menus.- multi_
select MultiSelect— Notion’s multi-select picker: names chosen from a shared set, several at once, and the set managed in place.- pagination
- Pagination — for data that arrives in pages, not for lists that are long.
- palette
CommandPalette— a filtered command list over ainput::TextField.- pending
PendingKeys— the prefix of a key sequence gpui is holding, and what can follow it.- popover
- Popover / menu primitives: an anchored floating layer with the
menu-inanimation, outside-click dismissal, and pure keyboard-navigation + search reducers shared by every picker and menu (feature-inventory §1.12 popovers). - scroll
- What gpui’s own scroll handles leave to the app: a container that scrolls the way it was asked to, a bar to show the position, and a rule for which pane a wheel belongs to.
- split
- Two panes with a draggable divider. The host owns and persists the ratio.
- stack
- The two stacks, at the system gap.
- stats
Stats— the meter: how many frames this window is drawing, and what the process, the GPU and memory cost, while you watch it.- surface
crate::surface— the backdrop surface a floating card sits on: wraps a popover/dialog card so its ENTIRE subtree paints inside one scene layer (a single draw order).- table
- Table — for rows that are tuples.
- tabs
- Tabs — an ordered strip of open things, one of them in front.
- tiled_
image - titlebar
titlebar— the strip a window with no system titlebar moves itself by.- tooltip
Tooltip— the small hover label.- tree
- Tree view — nested rows with disclosure, indent guides and arrow keys.
- widgets
- Widgets, grouped as catalog traits on
Theme— import the group, reach the component:use ui::widgets::{Content, Controls, Icons, Layout, Scaffolding, Status};→theme.group_box(),theme.tab(..). - window
frame— the border, corners, shadow and resize edges of a window the system does not decorate.content— the card an app’s main view sits on, inside that window.
Traits§
- AppExt
- Configuration carried by the application. Import as
use ui::AppExt as _;.
Functions§
- register_
fonts - Register the bundled fonts through
fonts::add. Failure is non-fatal: the theme’s system fallbacks take over (same families the CSS stack names). With nogeist-*feature on, it registers nothing and returnsOk.