AshSDUI.Resource.Standalone (ash_sdui v0.2.0)

Copy Markdown View Source

Parent DSL for standalone SDUI resource annotation modules.

This module enables the sdui do...end block in non-Ash modules that exist solely to declare UI metadata for a domain resource.

Usage

defmodule MyApp.UI.Resources.PlayerUI do
  use AshSDUI.Resource.Standalone

  sdui do
    for_resource MyApp.Player
    default_component "Player.Card@v1"
    view :index, recipe: :collection, read_action: :read
    ui_intent :create, style: :primary, target: {:navigate, "/players/new"}
    ui_field :name, label: "Player Name"
  end
end

Options

  • :extensions (list of module that adopts Spark.Dsl.Extension) - A list of DSL extensions to add to the Spark.Dsl

  • :otp_app (atom/0) - The otp_app to use for any application configurable options

  • :fragments (list of module/0) - Fragments to include in the Spark.Dsl. See the fragments guide for more.