Skip to main content

primary_button

Function primary_button 

Source
pub fn primary_button(
    id: impl Into<ElementId>,
    label: &str,
    enabled: bool,
    cx: &App,
) -> Stateful<Div>
Expand description

Create a primary button with the specified label

The button is styled using the theme’s primary colors when enabled, and disabled colors when not enabled. Buttons are focusable tab stops that can be activated with Enter or Space.

§Arguments

  • id - Element ID for the button (required for click handlers)
  • label - The text to display on the button
  • enabled - Whether the button is enabled (affects styling and cursor)
  • cx - Application context to access the theme

§Returns

A focusable Stateful<Div> that can be composed with .on_click() and other handlers.