JobyKit.PageComponent (JobyKit v0.3.2)

Copy Markdown View Source

Function components that render the JobyKit design surfaces.

Two surfaces are exposed:

  • page_component/1 — JobyKit's curated /design page. Renders the decision tree, wrapper contract, every entry whose module the kit owns, and the daisyUI catalogue. Identical across every JobyKit consumer; this is the agentic-first contract surface.

  • custom_page_component/1 — host-defined composites and domain components. Renders every entry the kit does not own, plus a slim breadcrumb back to /design. Hosts mount this at any path they like (/custom-designs, /composites, etc.).

The split is by module ownership, not by declared category. Category is a host-chosen atom, so keying the pages off it meant an app could register its own component as :core and have it appear on the kit's page as though JobyKit shipped it. Category now groups entries within whichever page owns them.

Both consume the same manifest module (use JobyKit.Manifest) but filter differently. The JSON endpoint (JobyKit.ManifestController) returns all entries — kit core + composites + domain — so agents have a single source of truth.

Hosts wrap these components in their own LiveView render and supply page chrome (layout, headers, navigation).

Summary

Functions

Host page renderer for composites and domain components.

The modules whose components page_component/1 treats as kit-provided.

Functions

custom_page_component(assigns)

Host page renderer for composites and domain components.

Filters the manifest to only :composite and :domain entries (anything that is not :core). The kit's /design page never surfaces these — that's by design, so the kit's catalogue stays uniform across every consumer. Use this component on a separate route (typically /custom-designs) to give your composites and domain components their own discoverable surface.

Attributes

  • manifest (:atom) (required)
  • back_to (:string) - Defaults to "/design".
  • title (:string) - Defaults to "Custom designs".
  • description (:string) - Defaults to "Composites and domain components defined by this app. The kit's curated wrapper inventory and the wrapper contract live on /design.".

kit_component_modules()

@spec kit_component_modules() :: [module()]

The modules whose components page_component/1 treats as kit-provided.

Everything else a manifest registers belongs on the custom-designs page, whatever category it declares.

page_component(assigns)

Attributes

  • manifest (:atom) (required)
  • custom_path (:string) - Defaults to nil.