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>
Attribute Type Documentation Default Value
class :any Any additional classes to be added. Variations of the component should be expressed via modifier attributes, and it is preferable to use styles on the parent container to arrange components on the page, but if you have to, you can use this attribute to pass additional utility classes to the component. The value can be a string or a list of strings. []
Required label * :string A accessibility label for the group. Set as `aria-label` attribute.
rest :global Any additional HTML attributes.
Required item * :slot
<:item on_click={JS.dispatch("switch-theme-light")}>Light</:item>
<:item on_click={JS.dispatch("switch-theme-dark")}>Dark</:item>