functora-egui 0.4.2

shadcn/ui-inspired widget library for egui - buttons, inputs, selects, dialogs, and 70+ more components with light/dark theming
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Kbd builder struct — a keyboard shortcut badge.

/// A keyboard shortcut display: `rounded-md border bg-muted px-1.5 text-xs font-mono`.
#[must_use]
pub struct Kbd {
    pub(crate) text: String,
}

impl Kbd {
    pub fn new(text: impl Into<String>) -> Self {
        Self { text: text.into() }
    }

    pub fn show(self, ui: &mut egui::Ui) -> egui::Response {
        ui.add(self)
    }
}