Skip to main content

split_leading_button

Function split_leading_button 

Source
pub fn split_leading_button() -> SplitLeadingButtonBuilder
Expand description

§split_leading_button

Render the leading button for a split button pair.

§Usage

Use as the primary action within a split button.

§Parameters

  • variant — visual emphasis variant.
  • size — split button size preset.
  • enabled — optional enabled state; defaults to true.
  • modifier — optional modifier chain applied to the leading button.
  • on_click — optional click callback.
  • accessibility_label — optional accessibility label.
  • accessibility_description — optional accessibility description.
  • interaction_state — optional shared pointer and focus state.
  • shape — fixed shape override that suppresses automatic corner changes.
  • content — leading icon and label, sized and placed in a row.

§Examples

use tessera_components::{
    split_buttons::split_leading_button, text::text, theme::material_theme,
};
use tessera_ui::{remember, tessera};

#[tessera]
fn component() {
    let activations = remember(|| 0_u32);
    material_theme().child(move || {
        split_leading_button()
            .accessibility_label("Send")
            .on_click(move || activations.set(activations.get() + 1))
            .content(|| {
                text("Send");
            });
    });
    assert_eq!(activations.get(), 0);
}