# `PhoenixKitWeb.Components.Core.AdminEditLink`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v2.22.2/lib/phoenix_kit_web/components/core/admin_edit_link.ex#L1)

Renders the "Edit" link a host drops into a public page's layout to reach
the matching admin page.

Reads plain assigns — no scope check happens here. The gate lives in
`PhoenixKitWeb.AdminEditHelper.assign_admin_edit/3`, the producer that sets
`:admin_edit_url`/`:admin_edit_label`; this component only decides how to
render them, and renders nothing when `:url` is `nil` (unauthenticated
visitor, non-admin, or a page nobody called the producer for).

## Examples

    <.admin_edit_link url={assigns[:admin_edit_url]} label={assigns[:admin_edit_label]} />

    <.admin_edit_link
      url={assigns[:admin_edit_url]}
      label={assigns[:admin_edit_label]}
      variant={:menu_item}
    />

# `admin_edit_link`

Renders an edit link into the matching admin page.

## Attributes

  * `:url` — the admin page path. Renders nothing when `nil` (default).
  * `:label` — link text. Defaults to gettext "Edit" when `nil`.
  * `:variant` — `:button` (default, a standalone outlined button) or
    `:menu_item` (a daisyUI `menu` `<li>`, for dropdowns like
    `PhoenixKitWeb.Components.UserDashboardNav.user_dropdown/1`).
  * `:class` — extra classes appended to the variant's base classes.
  * `:rest` — passed through to the underlying `<.link>`.

## Attributes

* `url` (`:string`) - Defaults to `nil`.
* `label` (`:string`) - Defaults to `nil`.
* `variant` (`:atom`) - Defaults to `:button`. Must be one of `:button`, or `:menu_item`.
* `class` (`:any`) - Defaults to `nil`.
* Global attributes are accepted.

---

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