# `PhoenixKitProjects.DashboardWidgets`
[🔗](https://github.com/BeamLabEU/phoenix_kit_projects/blob/v0.21.2/lib/phoenix_kit_projects/dashboard_widgets.ex#L1)

The dashboard **widgets** `phoenix_kit_projects` contributes to
`phoenix_kit_dashboards`.

Exposed through `PhoenixKitProjects.phoenix_kit_widgets/0` — a plain-map,
one-way contract: projects knows nothing about the dashboards package; the
dashboards Registry discovers this list, normalizes each map into a `%Widget{}`,
and gates visibility on the `"projects"` module being enabled + permitted.

Each `:component` is a `Phoenix.LiveComponent` under
`PhoenixKitProjects.Web.Widgets.*` that receives `settings` / `view` / `size` /
`scope` and re-queries on the host's refresh tick. Views declare their own
`min_size` where the layouts genuinely differ (a detailed table needs more
room than a KPI strip), so the dashboards builder floors resizing per view.
Sizes are in the dashboards **lattice units** (25px nominal square cells —
a screenful is e.g. 64×36).

The single-project widgets pick their project from a **select of current
projects** (`project_options/0` — evaluated when the widget catalog is built,
so a brand-new project appears after a registry refresh). The stored value is
the project uuid; the blank option means "first running project", and stale
stored values still resolve leniently (uuid / name / external id / substring)
via `Web.Widgets.Helpers.resolve_project/1`.

# `all`

```elixir
@spec all() :: [map()]
```

The list of widget definitions (plain maps) for `phoenix_kit_widgets/0`.

# `project_options`

```elixir
@spec project_options() :: [{String.t(), String.t()}]
```

Select options for the `"project"` setting: `{name, uuid}` for every current
(non-template, non-archived) project, blank = first running. Degrades to just
the blank option when the module/tables aren't available.

---

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