kitchen_ui/widgets/button.rs
1//! The icon button.
2
3use gpui_kit::SharedString;
4use gpui_kit::component::button::{Button, ButtonVariants as _};
5use gpui_kit::component::{Icon, Sizable as _};
6use gpui_kit::ElementId;
7
8/// A small ghost icon button with a tooltip (the tooltip names what it does, since the icon
9/// alone may not). gpui-kit's small size: about 24 px square at the default text size
10/// (designparser `touch-target`).
11pub fn icon_button(id: impl Into<ElementId>, icon: impl Into<Icon>, tooltip: impl Into<SharedString>) -> Button {
12 Button::new(id).ghost().small().icon(icon).tooltip(tooltip.into())
13}