Skip to main content

egui_components/
lib.rs

1//! gpui-component-style component library for [`egui`] 0.34, ported from
2//! [`gpui-component`](https://github.com/longbridge/gpui-component).
3//!
4//! All components are idiomatic egui widgets that return [`egui::Response`].
5//! Most can be added with `ui.add(Button::primary("OK"))`; a few that need
6//! to return extra info (e.g. [`Tag::show`]) provide a `.show(ui)` method.
7//!
8//! Theming comes from [`egui_components_theme::Theme`]. Install it once at
9//! startup:
10//!
11//! ```no_run
12//! # let ctx = egui::Context::default();
13//! egui_components_theme::Theme::dark().install(&ctx);
14//! ```
15//!
16//! Components read the installed theme via [`egui_components_theme::Theme::get`].
17
18pub mod accordion;
19pub mod alert;
20pub mod avatar;
21pub mod badge;
22pub mod breadcrumb;
23pub mod button;
24pub mod card;
25pub mod checkbox;
26pub mod collapsible;
27pub mod common;
28pub mod description_list;
29pub mod dialog;
30pub mod form;
31pub mod heading;
32pub mod hover_card;
33pub mod icon;
34pub mod input;
35pub mod label;
36pub mod link;
37pub mod list;
38pub mod menu;
39pub mod notification;
40pub mod number_input;
41pub mod otp_input;
42pub mod pagination;
43pub mod popover;
44pub mod progress;
45pub mod radio;
46pub mod rating;
47pub mod resizable;
48pub mod scroll_area;
49pub mod select;
50pub mod separator;
51pub mod sidebar;
52pub mod slider;
53pub mod switch;
54pub mod tabs;
55pub mod tag;
56pub mod titlebar;
57pub mod tooltip;
58pub mod tree;
59
60pub use accordion::Accordion;
61pub use alert::Alert;
62pub use avatar::{Avatar, AvatarShape, AvatarStatus};
63pub use badge::Badge;
64pub use breadcrumb::Breadcrumb;
65pub use button::Button;
66pub use card::{Card, CardVariant};
67pub use checkbox::Checkbox;
68pub use collapsible::Collapsible;
69pub use common::{Size, Variant};
70pub use description_list::DescriptionList;
71pub use dialog::{AlertChoice, AlertDialog, Dialog};
72pub use form::{Form, FormUi};
73pub use heading::{Heading, HeadingLevel};
74pub use hover_card::HoverCard;
75pub use icon::{Icon, IconKind};
76pub use input::Input;
77pub use label::{Label, LabelTone};
78pub use link::Link;
79pub use list::{List, ListItem};
80pub use menu::Menu;
81pub use notification::{ToastAnchor, Toasts};
82pub use number_input::NumberInput;
83pub use otp_input::OtpInput;
84pub use pagination::Pagination;
85pub use popover::Popover;
86pub use progress::Progress;
87pub use radio::Radio;
88pub use rating::Rating;
89pub use resizable::Resizable;
90pub use scroll_area::ScrollArea;
91pub use select::Select;
92pub use separator::Separator;
93pub use sidebar::{Rail, RailUi, Sidebar, SidebarUi};
94pub use slider::Slider;
95pub use switch::Switch;
96pub use tabs::{TabVariant, Tabs};
97pub use tag::{Tag, TagResponse};
98pub use titlebar::TitleBar;
99pub use tooltip::Tooltip;
100pub use tree::{
101    show_themed as show_themed_tree, Tree, TreeAction, TreeView, TreeViewBuilder,
102    TreeViewSettings, TreeViewState,
103};
104
105pub use egui_components_theme as theme;