AccrueAdmin.Components.IdBadge (accrue_admin v1.5.0)

Copy Markdown View Source

Interactive click-to-copy monospace ID chip.

Distinct from the display-only InlineId (ax-inline-id): IdBadge is a clickable control that copies its id_value to the clipboard via the registered Clipboard LiveView hook. Because the hook mounts per-element, copy keeps working on rows appended by infinite-scroll and rows re-rendered on filter push_patch.

<IdBadge.id_badge id="ax-id-badge-cus_1" id_value="cus_phase191_host_1" />

phx-hook requires a unique DOM id. Callers rendering a chip per list row MUST pass a row-derived id (e.g. id={"ax-id-badge-" <> to_string(row.id)}). When no id is supplied it derives a stable one from id_value.

Summary

Functions

id_badge(assigns)

Attributes

  • id (:string) - Defaults to nil.
  • id_value (:string) (required)
  • label (:string) - Defaults to nil.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.