# Menu ```rust demo //let message = use_message(); //let on_select = move |key: String| { // match key.as_str() { // "facebook" => message.create( "Facebook".into(), MessageVariant::Success, Default::default(),), // "twitter" => message.create( "Twitter".into(), MessageVariant::Warning, Default::default(),), // _ => () // } //}; let on_select = move |key| println!("{}", key); view! { } ``` ### Placement ```rust demo use leptos_meta::Style; let on_select = move |key| println!("{}", key); view! { "Content" "Content" "Content" "Content" "Content" "Content" "Content" "Content" "Content" "Content" "Content" "Content" } ``` ### Menu Props | Name | Type | Default | Description | | ------------ | ----------------------------------- | ---------------------------- | ------------------------------------------- | | class | `OptionalProp>` | `Default::default()` | Addtional classes for the menu element. | | on_select | `Callback` | | Called when item is selected. | | trigger_type | `MenuTriggerType` | `MenuTriggerType::Click` | Action that displays the menu. | | placement | `MenuPlacement` | `MenuPlacement::Bottom` | Menu placement. | | children | `Children` | | The content inside menu. | ### MenuItem Props | Name | Type | Default | Description | | -------- | -------------------------------------------- | -------------------- | ------------------------------------------------ | | class | `OptionalProp>` | `Default::default()` | Addtional classes for the menu item element. | | key | `MaybeSignal` | `Default::default()` | The key of the menu item. | | label | `MaybeSignal` | `Default::default()` | The label of the menu item. | | icon | `OptionalMaybeSignal` | `None` | The icon of the menu item. | | disabled | `MaybeSignal` | `false` | Whether the menu item is disabled. | ### Menu Slots | Name | Default | Description | | --------------- | ------- | ------------------------------------------------ | | MenuTrigger | `None` | The element or component that triggers menu. | ### MenuTriger Props | Name | Type | Default | Description | | ------------ | ----------------------------------- | ---------------------------- | -------------------------------------------------- | | class | `OptionalProp>` | `Default::default()` | Addtional classes for the menu trigger element. | | children | `Children` | | The content inside menu trigger. |