# 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 |value| println!("{}", value); view! { "Facebook" "Twitter" "Facebook" "Twitter" "Mastodon" } ``` ### Placement ```rust demo use leptos_meta::Style; let on_select = move |value| println!("{}", value); 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. | | position | `MenuPosition` | `MenuPosition::Bottom` | Menu position. | | children | `Children` | | The content inside menu. | ### MenuItem Props | Name | Type | Default | Description | | --- | --- | --- | --- | | class | `OptionalProp>` | `Default::default()` | Addtional classes for the menu item element. | | value | `MaybeSignal` | `Default::default()` | The value 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. |