Expand description
Behavior and infrastructure foundations for GPUI applications.
Primitives deliberately avoid presentation styles. Layout, positioning,
colors, sizing, and motion belong to applications or the
gpui-component façade.
Re-exports§
pub use component_traits::FocusableExt;pub use component_traits::Disableable;pub use component_traits::Selectable;pub use input::Editor;pub use input::Input;pub use input::InputBase;pub use input::InputStyles;pub use input::Textarea;pub use motion::Discrete;pub use motion::DiscreteError;pub use motion::Easing;pub use motion::EasingError;pub use motion::Interpolate;pub use motion::IterationCount;pub use motion::Keyframe;pub use motion::KeyframeError;pub use motion::Keyframes;pub use motion::LinearStop;pub use motion::MotionPhase;pub use motion::MotionReveal;pub use motion::MotionStatus;pub use motion::MotionTransform;pub use motion::MotionValue;pub use motion::PlaybackDirection;pub use motion::Presence;pub use motion::PresencePhase;pub use motion::PresenceSample;pub use motion::SignedDuration;pub use motion::Spring;pub use motion::SpringError;pub use motion::Stagger;pub use motion::StaggerOrigin;pub use motion::StepPosition;pub use motion::Timing;pub use motion::TimingSample;pub use motion::Transition;pub use motion::TransitionId;pub use motion::animate_keyframes;pub use motion::spring;pub use motion::transition;pub use motion::transition_with_status;pub use slider::Slider;pub use slider::SliderIndicator;pub use slider::SliderThumb;pub use slider::SliderTrack;pub use text::MarkdownExtensions;pub use text::MarkdownNode;pub use text::MarkdownPlugin;pub use text::SelectionFormat;pub use text::TableData;pub use text::Text;pub use text::TextView;pub use text::TextViewDefaults;pub use text::TextViewPlugin;pub use text::TextViewState;pub use text::TextViewStyle;pub use text::html;pub use text::markdown;pub use theme_tokens::ColorTokens;pub use theme_tokens::RadiusTokens;pub use theme_tokens::SemanticThemeTokens;pub use theme_tokens::ShadowTokens;pub use theme_tokens::SpacingTokens;pub use theme_tokens::TextStyleToken;pub use theme_tokens::TypographyTokens;
Modules§
- actions
- Common actions shared by keyboard-driven GPUI controls.
- animation
- component_
traits - dock
- Dockable layout: splits, tab groups, and tiles canvases that a host can rearrange, persist, and restore — with no appearance of its own.
- input
- Text input: the shared editing engine and the three states built on it.
- motion
- slider
- text
- theme_
tokens - Semantic design tokens shared by application-owned components.
Structs§
- Accordion
- An unstyled accordion root for application-owned items.
- Accordion
Header - An unstyled heading that owns the trigger for one accordion item.
- Accordion
Item - An unstyled accordion item connecting one trigger with its panel content.
- Accordion
Panel - An unstyled accordion panel with controlled mounting.
- Accordion
Trigger - An unstyled accordion trigger with controlled expanded state.
- Alert
Dialog - Alert-dialog specialization of the Base modal host.
- Alert
Dialog Action - Wrapper that dispatches the alert dialog’s confirm action.
- Alert
Dialog Backdrop - Alert
Dialog Cancel - Alert
Dialog Close - Alert
Dialog Description - Alert
Dialog Popup - Alert
Dialog Title - Alert
Dialog Trigger - Auto
Scroll - Manages timer-based auto-scrolling during drag interactions.
- Avatar
- An unstyled avatar root that renders its image slot or fallback slot.
- Avatar
Fallback - An unstyled avatar fallback slot for initials or an application-owned icon.
- Avatar
Image - An unstyled avatar image slot.
- Button
- An unstyled button that owns interaction, focus, keyboard, and accessibility behavior.
- Button
Styles - Semantic styles supported by
Button. - Calendar
- Complete unstyled calendar structure and behavior.
- Calendar
Item - An unstyled, pre-wired calendar item passed to the item slot.
- Calendar
Item State - State exposed to a calendar item slot. Applications may use it solely to decorate the unstyled primitive; all interaction remains owned by base.
- Calendar
State - Checkbox
- An unstyled checkbox that owns toggle, focus, keyboard, and accessibility behavior.
- Checkbox
Indicator - An unstyled checkbox indicator part with typed checkbox-state projection.
- Checkbox
Indicator Styles - Semantic styles supported by
CheckboxIndicator. - Checkbox
Styles - Semantic styles supported by
Checkbox. - Collapsible
- An unstyled controlled region whose content can be expanded or collapsed.
- Color
Picker - An unstyled controlled color-picker root.
- Color
Picker State - State and interaction model for a color picker.
- Color
Swatch - An unstyled selectable color in a picker’s palette.
- Combobox
- An unstyled controlled combobox root.
- Date
Picker - Unstyled controlled date-picker root. Applications own its trigger, calendar, positioning, and visual presentation; Base owns focus and open/dismiss keyboard behavior.
- Decrement
- Deferred
Popover - Holds the deferred interaction context open for as long as it is alive.
- Dialog
- Unstyled modal host owning focus, keyboard actions, dismissal, and callback ordering.
- Dialog
Backdrop - Unstyled backdrop part rendered behind a dialog popup.
- Dialog
Close - Wrapper that dispatches the dialog cancel action when activated.
- Dialog
Description - Unstyled descriptive-content slot for a dialog surface.
- Dialog
Handle - Dialog
Popup - Unstyled popup part containing dialog content.
- Dialog
Title - Unstyled title slot for a dialog surface.
- Dialog
Trigger - Unstyled trigger that owns pointer activation for opening a dialog.
- Edges
- A struct for defining the edges of an element.
- Global
State - Application-wide state shared by Base behaviors.
- History
- A browser-style linear trail with a current entry.
- Hover
Card - An unstyled hover-triggered popup with delayed open and close behavior.
- Hover
Card State - State exposed to a
HoverCard::contentbuilder. - Hsla
Sliders - The four component sliders owned by a
ColorPickerState. - Increment
- Index
Path - Represents an index path in a list, which consists of a section index,
- Interval
Matcher - Link
- An unstyled link that owns focus, activation, and accessibility semantics.
- Link
Styles - Semantic root styles supported by
Link. - List
Settings - Global settings for list presentation behavior.
- Measure
- An elapsed-time measurement emitted through
tracingwhen ended. - NavPage
- One mounted view of a
NavStack, handed to the item renderer. - NavStack
- An unstyled host for a
NavStackState. - NavStack
State - A stack of views, one visible at a time, with the pages popped off it
kept for
forward. - Number
Input - An unstyled spinbutton root composed from the foundational
InputBaseframe. - Number
Input Text - The built-in text region of a
NumberInput. - OtpInput
- Unstyled OTP interaction root. Applications provide the visual cells as children.
- OtpState
- Stateful input and focus behavior for a fixed-length numeric one-time code.
- Pagination
- An unstyled pagination navigation landmark.
- Pagination
State - The controlled behavior shared by every part of a pagination control.
- Popover
- An unstyled popover owning trigger interaction, open state, dismissal, and focus.
- Popover
State - State and focus lifecycle for an unstyled popover.
- Popup
- An unstyled trigger and anchored popup host.
- Positioner
- An unstyled element that positions its children as an anchored popup.
- Progress
- An unstyled linear progress root with controlled value accessibility.
- Progress
Indicator - An unstyled progress indicator.
- Progress
Track - An unstyled progress track.
- Radio
- An unstyled radio control that owns activation, focus, and accessibility behavior.
- Radio
Group - An unstyled container for a set of radio elements.
- Radio
Styles - Semantic root styles supported by
Radio. - Range
Matcher - Resizable
Panel - A resizable panel inside a
ResizablePanelGroup. - Resizable
Panel Group - A group of resizable panels.
- Resizable
State - State for a
ResizablePanel - Resizable
Theme - Global visual defaults used by resizable panel handles.
- Resize
Handle Context - What a
ResizeHandleRendereris told about the handle it is drawing. - Resolved
Position - The bounds a popup resolved to, and the side it ended up on.
- Scrollable
Mask - Make a scrollable mask element to cover the parent view with the mouse wheel event listening.
- Scrollbar
- Scrollbar control for scroll-area or a uniform-list.
- Scrollbar
Motion - Motion tokens used by
Scrollbar. - Scrollbar
Styles - Typed paint styles supported by
Scrollbar. - Scrollbar
Theme - Global defaults used by
crate::Scrollbar. - Scrollbar
Thumb Style - Paint-only styles for a scrollbar thumb.
- Scrollbar
Track Style - Paint-only styles for a scrollbar track.
- Select
- An unstyled controlled select root.
- Selectable
Text - Plain text that participates in the window-scoped
TextSelection. - Sheet
- An unstyled modal sheet host.
- State
Style - A semantic-state style builder.
- Switch
- An unstyled binary control that owns switch interaction and semantics.
- Switch
Styles - Semantic root styles supported by
Switch. - Switch
Thumb - An unstyled switch thumb with typed checked and disabled state projection.
- Switch
Thumb Styles - Semantic styles supported by
SwitchThumb. - Switch
Track - An unstyled switch track with typed checked and disabled state projection.
- Switch
Track Styles - Semantic styles supported by
SwitchTrack. - Tab
- An unstyled tab that owns pointer activation and accessibility behavior.
- TabStyles
- Table
- An unstyled semantic table root.
- Table
Body - An unstyled table body group.
- Table
Caption - An unstyled table caption slot.
- Table
Cell - An unstyled table data cell.
- Table
Head - An unstyled table column header.
- Table
Header - An unstyled table header group.
- Table
Row - An unstyled semantic table row.
- Tabs
- An unstyled collection root for
Tabelements. - Text
Selection - Window-level operations for text selection.
- Text
Selection Content Key - Stable participant-defined identity for virtualized participant content.
- Text
Selection Endpoint - A selection endpoint anchored to a participant’s content coordinates.
- Text
Selection Handle - A stable, participant-neutral handle for text that participates in window selection.
- Text
Selection Layer - A zero-sized root layer which enables text selection for a window.
- Text
Selection Projection - Selection projected onto a participant’s laid-out text runs.
- Text
Selection Registration - Per-frame geometry reported by a
TextSelectionHandleparticipant. - Text
Selection Run - Laid-out text reported by a plain selection participant during paint.
- Text
Selection Scope Id - An opaque selection layer identifier.
- Text
Selection Snapshot - Participant-relative selection endpoints with an optional rendering projection.
- Text
Selection Window Points - Window-coordinate anchor and cursor points for painting a selection.
- Theme
- Toast
- An unstyled semantic toast root. Applications own all presentation and motion.
- Toast
Advance - Changes produced when a toast manager advances its lifecycle clock.
- Toast
Manager - Ordered toast storage, lifecycle, auto-hide, limits, and exit coordination.
- Toast
Motion - Motion tokens used by an unstyled toast stack.
- Toast
Options - Options applied when a toast enters a
ToastManager. - Toast
Stack - A deep toast-stack element that owns measurement, overlap, and expansion motion.
- Toast
Stack State - Persistent private layout state used by
ToastStack. - Toggle
- An unstyled, controlled toggle button.
- Toggle
Group - An unstyled container for a set of toggle elements.
- Toggle
Styles - Semantic root styles supported by
Toggle. - Tooltip
- An unstyled tooltip popup.
- Tooltip
Overlay - Per-window tooltip provider and overlay.
- Tooltip
Positioner - An unstyled tooltip positioner with viewport-aware flipping and clamping.
- Tooltip
Request - Content requested by a tooltip trigger.
- Tree
- An unstyled, virtualized tree element.
- Tree
Entry - A flat representation of a tree item with its depth.
- Tree
Entry State - The interaction state supplied while rendering a visible tree entry.
- Tree
Item - A tree item with a stable id, display label, children, and shared state.
- Tree
State - Behavior and interaction state for a virtualized tree.
- Undo
History - A history of grouped undo transactions.
- Virtual
List - VirtualList component for rendering a large number of differently sized items.
- Virtual
List Scroll Handle - A scroll handle for
VirtualList.
Enums§
- Align
- Alignment of a popup along the side it is placed on.
- Calendar
Event - Calendar
Item Kind - The semantic kind of a calendar control rendered by
Calendar. - Calendar
View - Checkbox
State - The semantic value exposed by an unstyled
Checkbox. - Color
Picker Event - Events emitted by a
ColorPickerState. - Date
- A controlled calendar value.
- Dialog
Change Reason - Matcher
- NavMotion
- Whether one change runs the
NavStack’s transition, as UIKit’sanimated:and Qt’sStackView.Immediatedecide per call. - NavOperation
- What a running transition is doing, in Qt’s terms.
- NavStack
Event - Emitted by
NavStackStateafter the stack changed. - Number
Input Event - Number
Step - Strategy used by numeric editors when stepping their value.
- OtpEvent
- A semantic notification from a one-time-code state.
- Pagination
Item - A visible destination in a pagination control.
- Placement
- A enum for defining the placement of the element.
- Resizable
Panel Event - Role
Override - Scrollbar
Axis - Scrollbar axis.
- Scrollbar
Entrance - How a scrollbar becomes visible.
- Scrollbar
Mode - Scrollbar show mode.
- Side
- A enum for defining the side of the element.
- Step
Action - Text
Selection Coverage - How much of one participant participates in a window selection.
- Text
Selection Event - Notifications emitted by a text-selection participant.
- Theme
Appearance - Application-wide defaults for Base behavior modules.
- Toast
Transition Status - The lifecycle phase exposed by a toast root to application-owned presentation.
- Tooltip
Transition - Presentation transition requested by the Base tooltip lifecycle.
- Tree
Event - Event emitted by a tree when user-visible expansion state changes.
Constants§
- POPUP_
PRIORITY - Deferred paint priority for interactive surfaces that must appear above dialogs.
Traits§
- AxisExt
- A trait to extend the
Axisenum with utility methods. - Element
Ext - Extends a GPUI parent element with post-layout prepaint observation.
- Focus
Trap Element - An extension trait to add
focus_trapfunctionality to interactive elements. - Interactive
Element Ext - Length
Ext - A trait to extend the
Lengthenum with utility methods. - Ongoing
Scroll Ext - gpui delimits scroll gestures with
std::time::Instant, which is unimplemented on wasm32: the first wheel event over an axis-locked scroll area panics with “time not implemented on this platform” and takes the whole application down, leaving the canvas unresponsive. Losing the axis lock in the browser is by far the lesser cost, so the locks below are no-ops there. - Scrollbar
Handle - A trait for scroll handles that can get and set offset.
- Styled
Ext
Functions§
- box_
shadow - h_flex
- A row that centers its children on the cross axis.
- h_
resizable - Create a
ResizablePanelGroupwith horizontal resizing - h_
virtual_ list - Create a
VirtualListin horizontal direction. - init
- Initializes global infrastructure owned by the base layer.
- measure
- Measures
fwhen measurement logging is enabled. - measure_
if - Measures
fwhenif_is true and measurement logging is enabled. - resizable_
panel - Create a
ResizablePanel. - step_
value - Step a numeric string while preserving decimal precision and range direction.
- styled_
ext_ reflection_ methods - v_flex
- A column whose children stretch across the cross axis.
- v_
resizable - Create a
ResizablePanelGroupwith vertical resizing - v_
virtual_ list - Create a
VirtualListin vertical direction.
Type Aliases§
- Resize
Handle Renderer - Draws the visible part of a resize handle.