Menu Item Radio Group

Renders a group of menu item radios as part of a menu/1 or menu_bar/1.

Read more Read less

See also menu_button/1, menu_item/1, and menu_item_checkbox/1.

Usage

<.menu id="actions-menu" labelledby="actions-button" hidden>
  <:item>
    <.menu_item_radio_group label="Theme">
      <:item on_click={JS.dispatch("switch-theme-light")}>
        Light
      </:item>
      <:item on_click={JS.dispatch("switch-theme-dark")} checked>
        Dark
      </:item>
    </.menu_item_radio_group>
  </:item>
</.menu>
<.menu label="Actions">
  <:item>
    <.menu_item_radio_group label="Theme" on_click={%JS{ops: [["dispatch", %{event: "myapp:toggle-word-wrap"}]]}}>
      <:item on_click={JS.dispatch("switch-theme-light")}>Light</:item>
      <:item on_click={JS.dispatch("switch-theme-dark")}>Dark</:item>
    </.menu_item_radio_group>
  </:item>
</.menu>