Skip to main content

Module overlay

Module overlay 

Source
Expand description

Floating surfaces that render above the page.

Overlay owns placement, stacking and dismissal; FocusTrap keeps the keyboard inside an open overlay and gives focus back when it closes. Dialog composes both into a modal that asks one question, Drawer is the same surface arriving from an edge, and Tooltip is hover-delayed help that is never the only way to act. ToastLayer holds transient notifications, which report what happened and never hide a failure on a timer.

Popover is the anchored surface the menu family is built from: Menu hangs one off a trigger, ContextMenu opens the same list at the pointer, and CommandPalette filters it from the keyboard.

Re-exports§

pub use frost::Frost;
pub use hover_card::HoverCard;
pub use hover_card::HoverCardEvent;
pub use menubar::Menubar;
pub use menubar::MenubarEvent;
pub use menubar::MenubarMenu;
pub use notification_center::Notification;
pub use notification_center::NotificationCenter;
pub use notification_center::NotificationCenterEvent;
pub use notification_center::UnreadCount;
pub use popover::Popover;
pub use popover::PopoverEvent;
pub use toast::Toast;
pub use toast::ToastCorner;
pub use toast::ToastLayer;
pub use tooltip::Tooltip;
pub use tooltip::Tooltipped;

Modules§

frost
A surface that shows what is behind it, out of focus.
hover_card
A rich preview that opens on hover and can be reached.
menubar
The horizontal row of menus along the top of a window’s content.
notification_center
Where a notification goes after the toast that showed it has gone.
panel
The parts a modal surface and a drawer build from.
popover
The anchored surface every menu-shaped component is built from.
toast
Transient notifications that report what happened without hiding a failure.
tooltip
Hover-delayed help for a control that is already usable without it.

Structs§

Command
One thing the application can do.
CommandPalette
A query field over a list of commands.
ContextMenu
The same menu, opened at the pointer over a region rather than from a trigger.
Dialog
A composed modal: scrim, focus trap, title, body, and up to two actions.
Drawer
A panel anchored to one side of the window.
FocusTrap
The focus stops of one open overlay, in tab order.
Kbd
A keyboard shortcut, written the way the current platform writes it.
Menu
A list of commands, opened from a trigger.
MenuItem
One entry in a menu, identified by business identity rather than position.
Overlay
A floating surface.

Enums§

CommandPaletteEvent
What the palette reports. The owner decides what any of it means.
ContextMenuEvent
What a context menu reports.
DialogEvent
What the dialog reports. The owner decides what any of it means.
DrawerEvent
What the drawer reports. The owner decides what any of it means.
Edge
One side of the window.
MenuEvent
What a menu reports. The owner decides what any of it means.
Placement
Where a floating surface sits.

Functions§

caps
Splits a keystroke into the caps to draw.
priority
Maps a token layer onto GPUI’s deferred paint priority.
surface
A surface at one elevation, sized to its content.