Menu Item Checkbox

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

Read more Read less

See also menu_item/1.

Maturity: Developing

Missing features

  • State management: the component renders aria-checked from the checked attribute and never changes it, so the caller's on_click has to update the state and re-render.

Usage

<.menu id="actions-menu" label="Actions">
  <:item>
    <.menu_item_checkbox on_click={JS.dispatch("myapp:toggle-word-wrap")}>
      Word wrap
    </.menu_item_checkbox>
  </:item>
</.menu>
Attribute Type Documentation Default Value
checked :any

The checked state.

Read more Read less
false

If set to :indeterminate, the aria-checked="mixed" attribute is added, which stands for a group of items of which only some are checked.

class :any

Any additional classes to be added.

Read more Read less
[]

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 on_click * :any

Phoenix.LiveView.JS command or event name.

rest :global

Any additional HTML attributes.

Required inner_block * :slot
All notifications