Pre-built page scaffolds for the PhiaUI Design editor.
Each template function builds a set of nodes in a Scene, creating a ready-to-customize page layout with real PhiaUI components.
Templates return {:ok, scene} on success, or {:error, reason} on failure.
Node IDs are generated automatically so templates can be applied multiple times
to different scenes without collision.
Usage
scene = Scene.new()
{:ok, scene} = PageTemplates.apply_template(scene, :dashboard)Available templates
PageTemplates.list()
# => [%{key: :dashboard, name: "Dashboard", ...}, ...]
Summary
Functions
Apply a page template to a scene.
Get a single template's metadata by key.
Return the list of valid template keys.
List all available page templates with metadata.
List templates filtered by category.
Functions
@spec apply_template(PhiaUiDesign.Canvas.Scene.scene_id(), atom()) :: {:ok, PhiaUiDesign.Canvas.Scene.scene_id()} | {:error, atom()}
Apply a page template to a scene.
Inserts the template's nodes into the given scene and returns
{:ok, scene}. The scene is mutated in place (ETS), so the
returned reference is the same as the input.
Returns {:error, :unknown_template} if the key is not recognized.
Get a single template's metadata by key.
@spec keys() :: [atom()]
Return the list of valid template keys.
@spec list() :: [map()]
List all available page templates with metadata.
Returns a list of maps with :key, :name, :description, and :category.
List templates filtered by category.
Categories: :app, :auth, :marketing, :utility.