Skip to main content

nav_button

Function nav_button 

Source
pub fn nav_button(
    ui: &mut Ui,
    icon: &str,
    label: &str,
    is_selected: bool,
    has_warning: bool,
) -> Response
Expand description

Creates a pill-style navigation button with a circular icon background, styled after the web pages’ chip vocabulary: the selected entry is accent-filled, a hovered entry wears the chip tone, and the warning dot uses the stylesheet’s error color.

§Arguments

  • ui - The egui UI context
  • icon - The emoji or icon to display in the circle
  • label - The text label for the button
  • is_selected - Whether this button represents the currently selected page
  • has_warning - Whether to draw the small warning dot on the icon

§Returns

The response from the button interaction