# `PhoenixKitWeb.Components.Core.TableRowMenu`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.165/lib/phoenix_kit_web/components/core/table_row_menu.ex#L1)

Dropdown action menu for table rows.

Provides a compact "⋮" trigger button that opens a floating menu with action items.
Uses `position: fixed` via the `RowMenu` JS hook to escape `overflow-clip` table
containers — a common DaisyUI issue when dropdowns are nested inside tables.

The menu is automatically positioned to stay within the viewport: it opens below
the trigger by default, flips above if there's no space below, and aligns to the
right edge of the trigger (shifting left if that would clip off-screen).

Works on mobile and desktop. On mobile the menu is full-width clamped to viewport.

## Components

- `table_row_menu/1` — wrapper with trigger button, accepts items as inner_block
- `table_row_menu_link/1` — navigation item (`navigate` or `href`)
- `table_row_menu_button/1` — action item (`phx-click` and other events)
- `table_row_menu_divider/1` — visual separator between groups

## Example

    <.table_row_menu id={"menu-#{user.uuid}"}>
      <.table_row_menu_link
        navigate={Routes.path("/admin/users/view/#{user.uuid}")}
        icon="hero-eye"
        label={gettext("View")}
      />
      <.table_row_menu_link
        navigate={Routes.path("/admin/users/edit/#{user.uuid}")}
        icon="hero-pencil"
        label={gettext("Edit")}
        variant="secondary"
      />
      <.table_row_menu_divider />
      <.table_row_menu_button
        phx-click="delete"
        phx-value-id={user.uuid}
        icon="hero-trash"
        label={gettext("Delete")}
        variant="error"
      />
    </.table_row_menu>

# `table_row_menu`

Renders the dropdown trigger and menu container.

## Attributes

* `id` - Unique element ID (required). Used by the JS hook.
* `label` - Accessible label for the trigger button (optional, default: "Actions")
* `mode` - Display mode (optional, default: "dropdown"):
  - `"dropdown"` — always show the ⋮ dropdown menu (original behavior)
  - `"inline"` — always show actions as inline buttons (no dropdown)
  - `"auto"` — inline buttons on `md+` screens, dropdown on mobile
* `class` - Additional CSS classes for the wrapper (optional)

## Slots

* `inner_block` - Menu items (use `table_row_menu_link`, `table_row_menu_button`,
  `table_row_menu_divider`)

## Attributes

* `id` (`:string`) (required)
* `label` (`:string`) - Defaults to `"Actions"`.
* `mode` (`:string`) - Defaults to `"dropdown"`. Must be one of `"dropdown"`, `"inline"`, or `"auto"`.
* `class` (`:string`) - Defaults to `nil`.
* `trigger_class` (`:string`) - Defaults to `nil`.
## Slots

* `inner_block` (required)

# `table_row_menu_button`

Renders an action button item inside the menu.

## Attributes

* `icon` - Heroicon name, e.g. "hero-trash" (optional)
* `label` - Item label text (required)
* `variant` - Color variant: "default", "primary", "secondary", "info", "success",
  "warning", "error" (optional, default: "default")
* `rest` - Additional HTML attributes (phx-click, phx-value-*, data-confirm, etc.)

## Attributes

* `icon` (`:string`) - Defaults to `nil`.
* `label` (`:string`) (required)
* `variant` (`:string`) - Defaults to `"default"`.
* Global attributes are accepted.

# `table_row_menu_divider`

Renders a visual separator between menu item groups.

# `table_row_menu_link`

Renders a navigation link item inside the menu.

## Attributes

* `navigate` - LiveView navigate path (optional)
* `href` - Regular href (optional)
* `icon` - Heroicon name, e.g. "hero-eye" (optional)
* `label` - Item label text (required)
* `variant` - Color variant: "default", "primary", "secondary", "info", "success",
  "warning", "error" (optional, default: "default")
* `rest` - Additional HTML attributes passed to the `<a>` element. Includes
  `target` and `rel` (e.g. `target="_blank" rel="noopener noreferrer"` for
  external links opening in a new tab).

## Attributes

* `navigate` (`:string`) - Defaults to `nil`.
* `href` (`:string`) - Defaults to `nil`.
* `icon` (`:string`) - Defaults to `nil`.
* `label` (`:string`) (required)
* `variant` (`:string`) - Defaults to `"default"`.
* Global attributes are accepted. Supports all globals plus: `["target", "rel"]`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
