Primitives
GPUI Base primitives provide behavior without prescribing presentation. Each page documents the public import and the smallest useful composition. The live example above the page is built from crates/base/examples and can also run as a native GPUI application.
Primitive catalog
- Accordion — A disclosure group composed from independently styleable header, trigger, and panel parts.
- Alert Dialog — A modal confirmation surface for actions that need an explicit decision.
- Avatar — An image with composable fallback content for a person or entity.
- Button — An unstyled, accessible pressable with semantic state and keyboard activation.
- Calendar — A state-driven date grid with selection matchers and custom item rendering.
- Checkbox — A controlled tri-state check control with a separately styled indicator.
- Collapsible — A composable region that shows or hides content without prescribing its trigger styling.
- Color Picker — State and interaction foundations for selecting colors in a custom picker UI.
- Combobox — A text input paired with keyboard-navigable suggestions and selection behavior.
- Date Picker — A focus-aware date input that composes calendar behavior with a popup.
- Dialog — A composable modal surface with focus management, backdrop, title, and close parts.
- Hover Card — A delayed floating card associated with a pointer or keyboard trigger.
- Input — A single-line text input with selection, masking, validation, and number stepping.
- Textarea — A multi-line text field with fixed rows, wrapping, and auto-grow behavior.
- Editor — A source-code editor foundation with highlighting, gutter, folding, decorations, and LSP hooks.
- Link — An accessible link-like control with application-defined styling.
- Number Input — A numeric input with reusable increment, decrement, and step behavior.
- OTP Input — A multi-cell one-time-code input driven by a shared text state.
- Pagination — A controlled page navigator with explicit current and total page state.
- Popover — An anchored floating surface with controlled or internally managed open state.
- Popup — A low-level trigger and anchored floating-content host.
- Progress — Composable track and indicator parts for reporting task completion.
- Radio — A controlled single-choice item with selectable and disabled semantics.
- Radio Group — Groups radio items and provides keyboard navigation for a single selection.
- Resizable — Panel groups and resize handles for user-adjustable split layouts.
- Scrollbar — An unstyled scrollbar connected to GPUI scroll or uniform-list handles.
- Select — A button-like selection control backed by an anchored, keyboard-navigable popup.
- Sheet — A modal surface that enters from an edge while managing dismissal and focus.
- Slider — A state-driven range input with independently styleable track, indicator, and thumb.
- Switch — A controlled on/off control with separately styleable track and thumb.
- Table — Semantic table primitives for composing headers, bodies, rows, and cells.
- Tabs — A tab list and accessible tab controls with controlled selection.
- Toast — A managed, animated stack of temporary status messages.
- Toggle — A controlled two-state pressable for persistent choices such as formatting.
- Toggle Group — Coordinates a set of toggle controls as a single- or multiple-selection group.
- Tooltip — A delayed, positioned description associated with a trigger element.
- Tree — A virtualized hierarchical list with explicit expansion and selection state.