Skip to main content

Crate ui

Crate ui 

Source
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 Swatch set the app configures, and ColorPicker for 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 — tab and shift-tab between 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 of crate::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 lets crate::scroll::scrollbar report on one.
loaders
Loaders: the orb cluster, the pulse loader and the gradient matrix spinners. All motion routes through motion pure helpers, so the math is unit-tested and these elements are testable-by-compile.
menu
Item — a row in a dropped menu — and card, the panel that paints a list of them plus the panels its Item::Submenu rows 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 a input::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-in animation, 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.
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 no geist-* feature on, it registers nothing and returns Ok.