Skip to main content

split_trailing_button

Function split_trailing_button 

Source
pub fn split_trailing_button() -> SplitTrailingButtonBuilder
Expand description

§split_trailing_button

Render the trailing button for a split button pair.

§Usage

Use as a secondary action or menu affordance 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 trailing 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.
  • expanded — controlled menu disclosure state with popup semantics.
  • content — menu icon, sized automatically for the preset.

§Examples

use tessera_components::{
    icon::icon, material_icons::filled, menus::MenuController,
    split_buttons::split_trailing_button, theme::material_theme,
};
use tessera_ui::{remember, tessera};

#[tessera]
fn component() {
    let menu = remember(MenuController::new);
    material_theme().child(move || {
        split_trailing_button()
            .expanded(menu.with(MenuController::is_open))
            .accessibility_label("Send options")
            .on_click(move || menu.with_mut(MenuController::toggle))
            .content(|| {
                icon().painter(filled::ARROW_DROP_DOWN_SVG);
            });
    });
}