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§

combobox
Combobox — a select you can type into: the closed face of a select over an anchored menu whose rows narrow as you search.
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.
date
Calendar — a date picker: the closed face of a select over an anchored month grid.
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.
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.
pagination
Pagination — for data that arrives in pages, not for lists that are long.
palette
CommandPalette — a filtered command list over a input::TextField.
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.
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.
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(..).

Functions§

register_fonts
Register the bundled fonts with the gpui text system. Failure is non-fatal: the theme’s system fallbacks take over (same families the CSS stack names).