Skip to main content

Crate egui_components

Crate egui_components 

Source
Expand description

gpui-component-style component library for egui 0.34, ported from gpui-component.

All components are idiomatic egui widgets that return egui::Response. Most can be added with ui.add(Button::primary("OK")); a few that need to return extra info (e.g. Tag::show) provide a .show(ui) method.

Theming comes from egui_components_theme::Theme. Install it once at startup:

egui_components_theme::Theme::dark().install(&ctx);

Components read the installed theme via egui_components_theme::Theme::get.

Re-exports§

pub use accordion::Accordion;
pub use alert::Alert;
pub use avatar::Avatar;
pub use avatar::AvatarShape;
pub use avatar::AvatarStatus;
pub use badge::Badge;
pub use breadcrumb::Breadcrumb;
pub use button::Button;
pub use card::Card;
pub use card::CardVariant;
pub use checkbox::Checkbox;
pub use collapsible::Collapsible;
pub use common::Size;
pub use common::Variant;
pub use description_list::DescriptionList;
pub use dialog::AlertChoice;
pub use dialog::AlertDialog;
pub use dialog::Dialog;
pub use form::Form;
pub use form::FormUi;
pub use heading::Heading;
pub use heading::HeadingLevel;
pub use hover_card::HoverCard;
pub use icon::Icon;
pub use icon::IconKind;
pub use input::Input;
pub use label::Label;
pub use label::LabelTone;
pub use list::List;
pub use list::ListItem;
pub use menu::Menu;
pub use notification::ToastAnchor;
pub use notification::Toasts;
pub use number_input::NumberInput;
pub use otp_input::OtpInput;
pub use pagination::Pagination;
pub use popover::Popover;
pub use progress::Progress;
pub use radio::Radio;
pub use rating::Rating;
pub use resizable::Resizable;
pub use scroll_area::ScrollArea;
pub use select::Select;
pub use separator::Separator;
pub use sidebar::Rail;
pub use sidebar::RailUi;
pub use sidebar::Sidebar;
pub use sidebar::SidebarUi;
pub use slider::Slider;
pub use switch::Switch;
pub use tabs::TabVariant;
pub use tabs::Tabs;
pub use tag::Tag;
pub use tag::TagResponse;
pub use titlebar::TitleBar;
pub use tooltip::Tooltip;
pub use tree::show_themed as show_themed_tree;
pub use tree::Tree;
pub use egui_components_theme as theme;

Modules§

accordion
Accordion — a single collapsible section with an animated chevron.
alert
Alert widget — boxed inline message with optional title.
avatar
Avatar — a circular (or rounded-square) user thumbnail.
badge
Badge widget — small inline pill / chip.
breadcrumb
Breadcrumb — a horizontal trail of navigable links.
button
Button widget.
card
Card — a rounded surface that groups related content.
checkbox
Checkbox widget.
collapsible
Collapsible — the low-level show/hide primitive behind Accordion.
common
Shared types used across components.
description_list
DescriptionList — term / description pairs (an HTML <dl> equivalent).
dialog
Dialog and AlertDialog — modal overlays built on egui::Modal.
form
Form — vertical labeled-field layout.
heading
Heading — section title typography.
hover_card
HoverCard — a richer Tooltip that shows arbitrary content on hover.
icon
Icon — a small set of vector icons drawn with the painter.
input
gpui-component-style single-line Input field.
label
Theme-aware Label. A thin wrapper around egui::Label that knows about the theme’s semantic text colors (muted, secondary, primary, …).
link
Link — a themed hyperlink.
list
ListItem — a clickable, themed row used to build list-style UIs.
menu
Menu — a dropdown / context menu of clickable items.
notification
Notification toasts — transient messages stacked in a screen corner.
number_input
NumberInput — a numeric field flanked by / + stepper buttons.
otp_input
OtpInput — a row of single-character boxes for one-time codes.
pagination
Pagination — page navigation with prev/next arrows and numbered buttons (collapsing to ellipses when there are many pages).
popover
Popover — floating content anchored to a trigger widget.
progress
Progress — a horizontal progress bar (determinate or indeterminate).
radio
Radio — a single radio button. Pair several with the same backing value to form a group.
rating
Rating — a row of clickable stars bound to a &mut u32.
resizable
Resizable — two panes separated by a draggable divider.
scroll_area
ScrollArea — a theme-styled wrapper around egui::ScrollArea.
select
Select / Combobox — a dropdown that picks one option from a list.
separator
Separator widget. Horizontal or vertical thin line that follows the theme’s border color.
sidebar
Sidebar — a vertical navigation panel with icon + label items.
slider
Slider widget.
switch
Switch widget (toggle).
tabs
Tabs widget — a horizontal tab bar driving a &mut usize selection.
tag
Tag widget. Like Badge but with an optional close (×) button and click semantics.
titlebar
TitleBar — a custom window title bar (for borderless / custom-chrome apps).
tooltip
Tooltip — themed hover help attached to any widget Response.
tree
Tree widget powered by egui_ltreeview.

Structs§

TreeView
A tree view widget.
TreeViewBuilder
The builder used to construct the tree.
TreeViewSettings
The global settings the tree view will use.
TreeViewState
Represents the state of the tree view.

Enums§

TreeAction
An action the tree view would like to take as a result of some user input like drag and drop.