EssenceUI.Components.ContextMenu (Essence UI v0.2.0)

Copy Markdown View Source

Themed context menu with trigger, content, and item subcomponents.

Wraps EssenceUI.Primitives.ContextMenu with themed visual props (size, variant, color, high_contrast, shortcut).

Summary

Functions

Menu item with checkbox behavior.

The menu content. Portals into container (default "body").

Groups multiple items.

A standard menu item.

Non-interactive label.

Groups radio items.

Root container for the context menu.

Visual separator between items.

Sub-menu container.

Content of a sub-menu.

Trigger for a sub-menu.

The area that opens the context menu on right-click.

Functions

context_menu_checkbox_item(assigns)

Menu item with checkbox behavior.

Attributes

  • checked (:boolean) - Defaults to false.
  • shortcut (:string) - Defaults to nil.
  • color (:string) - Color utility class string. One of: gray, gold, bronze, brown, yellow, amber, orange, tomato, red, ruby, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, teal, jade, green, grass, lime, mint, sky. Must be one of "gray", "gold", "bronze", "brown", "yellow", "amber", "orange", "tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "indigo", "blue", "cyan", "teal", "jade", "green", "grass", "lime", "mint", or "sky".
  • disabled (:boolean) - Defaults to false.
  • text_value (:string) - Defaults to nil.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

context_menu_content(assigns)

The menu content. Portals into container (default "body").

Attributes

  • id (:string) - Defaults to nil.
  • size (:string) - Defaults to "2". Must be one of "1", or "2".
  • variant (:string) - Defaults to "solid". Must be one of "solid", or "soft".
  • container (:string) - Defaults to "body".
  • class (:string) - Defaults to nil.
  • color (:string) - Color utility class string. One of: gray, gold, bronze, brown, yellow, amber, orange, tomato, red, ruby, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, teal, jade, green, grass, lime, mint, sky. Must be one of "gray", "gold", "bronze", "brown", "yellow", "amber", "orange", "tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "indigo", "blue", "cyan", "teal", "jade", "green", "grass", "lime", "mint", or "sky".
  • high_contrast (:boolean) - Whether to increase color contrast with the background.
  • Global attributes are accepted.

Slots

  • inner_block (required)

context_menu_group(assigns)

Groups multiple items.

Attributes

  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

context_menu_item(assigns)

A standard menu item.

Attributes

  • shortcut (:string) - Defaults to nil.
  • color (:string) - Color utility class string. One of: gray, gold, bronze, brown, yellow, amber, orange, tomato, red, ruby, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, teal, jade, green, grass, lime, mint, sky. Must be one of "gray", "gold", "bronze", "brown", "yellow", "amber", "orange", "tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "indigo", "blue", "cyan", "teal", "jade", "green", "grass", "lime", "mint", or "sky".
  • disabled (:boolean) - Defaults to false.
  • text_value (:string) - Defaults to nil.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted. Supports all globals plus: ["phx-click", "phx-target", "value", "href"].

Slots

  • inner_block (required)

context_menu_label(assigns)

Non-interactive label.

Attributes

  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

context_menu_radio_group(assigns)

Groups radio items.

Attributes

  • value (:string) - Defaults to nil.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

context_menu_radio_item(assigns)

A radio menu item.

Attributes

  • value (:string) (required)
  • checked (:boolean) - Defaults to false.
  • color (:string) - Color utility class string. One of: gray, gold, bronze, brown, yellow, amber, orange, tomato, red, ruby, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, teal, jade, green, grass, lime, mint, sky. Must be one of "gray", "gold", "bronze", "brown", "yellow", "amber", "orange", "tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "indigo", "blue", "cyan", "teal", "jade", "green", "grass", "lime", "mint", or "sky".
  • disabled (:boolean) - Defaults to false.
  • text_value (:string) - Defaults to nil.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

context_menu_root(assigns)

Root container for the context menu.

Attributes

  • id (:string) - Defaults to nil.
  • open (:boolean) - Defaults to false.
  • default_open (:boolean) - Defaults to false.
  • on_open_change (:string) - Defaults to nil.
  • dir (:string) - Defaults to "ltr". Must be one of "ltr", or "rtl".
  • modal (:boolean) - Defaults to true.
  • class (:string) - Defaults to nil.
  • style (:string) - Defaults to "".
  • Global attributes are accepted.

Slots

  • inner_block (required)

context_menu_separator(assigns)

Visual separator between items.

Attributes

  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

context_menu_sub(assigns)

Sub-menu container.

Attributes

  • open (:boolean) - Defaults to false.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

context_menu_sub_content(assigns)

Content of a sub-menu.

Attributes

  • id (:string) - Defaults to nil.
  • side (:string) - Defaults to "right". Must be one of "top", "right", "bottom", or "left".
  • align (:string) - Defaults to "start". Must be one of "start", "center", or "end".
  • side_offset (:integer) - Defaults to 1.
  • size (:string) - Defaults to "2". Must be one of "1", or "2".
  • variant (:string) - Defaults to "solid". Must be one of "solid", or "soft".
  • class (:string) - Defaults to nil.
  • color (:string) - Color utility class string. One of: gray, gold, bronze, brown, yellow, amber, orange, tomato, red, ruby, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, teal, jade, green, grass, lime, mint, sky. Must be one of "gray", "gold", "bronze", "brown", "yellow", "amber", "orange", "tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "indigo", "blue", "cyan", "teal", "jade", "green", "grass", "lime", "mint", or "sky".
  • high_contrast (:boolean) - Whether to increase color contrast with the background.
  • Global attributes are accepted.

Slots

  • inner_block (required)

context_menu_sub_trigger(assigns)

Trigger for a sub-menu.

Attributes

  • disabled (:boolean) - Defaults to false.
  • text_value (:string) - Defaults to nil.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

context_menu_trigger(assigns)

The area that opens the context menu on right-click.

Attributes

  • id (:string) - Defaults to nil.
  • content_id (:string) - Defaults to nil.
  • disabled (:boolean) - Defaults to false.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)