PhoenixKitDashboards (PhoenixKitDashboards v0.1.0)

Copy Markdown View Source

Customizable dashboards for PhoenixKit.

Lets users compose dashboard pages from widgets contributed by any PhoenixKit module. A widget is a self-contained Phoenix.LiveComponent; a dashboard is a free-form 2D grid of placed widget instances, each with its own size, position, and settings. Layouts are persisted per user (personal dashboards) and per system/role (shared dashboards).

Architecture

Exposing widgets from another module

Any module can contribute widgets by defining a zero-arity phoenix_kit_widgets/0 returning plain maps — no dependency on this package:

def phoenix_kit_widgets do
  [%{key: "emails.deliverability", name: "Deliverability",
     module_key: "emails", component: PhoenixKitEmails.Widgets.DeliverabilityLive,
     default_size: %{w: 6, h: 2}}]
end

See PhoenixKitDashboards.Widget for the full contract.

Summary

Functions

This module's own widgets, exposed through the same phoenix_kit_widgets/0 contract every other module uses (see the "Exposing widgets" section above), so the Registry discovers them uniformly — the built-ins are a live worked example of the contract, not a special-cased internal path.

Functions

phoenix_kit_widgets()

@spec phoenix_kit_widgets() :: [map()]

This module's own widgets, exposed through the same phoenix_kit_widgets/0 contract every other module uses (see the "Exposing widgets" section above), so the Registry discovers them uniformly — the built-ins are a live worked example of the contract, not a special-cased internal path.