Incant combines application configuration with module DSL options. Library mode uses host Phoenix and asset configuration; standalone mode additionally reads endpoint and registry environment variables.
Application Options
UI Adapter
config :incant,
ui_adapter: Incant.UI.Adapters.LiveViewDefault semantic UI adapter.
Density
config :incant, density: :compactDefault adapter density. Themes may support :compact, :comfortable, and :spacious.
Per-Admin UI
config :incant, MyApp.Admin,
density: :comfortableOverrides application UI options for one admin root.
Global Naming
config :incant,
naming: [terms: %{api: "API", oauth: "OAuth"}]Fallback naming vocabulary. Admin-root naming takes precedence when contracts are resolved.
Standalone Serving
config :incant, serve?: trueStarts Incant PubSub, registry server, and endpoint. Default: false.
Standalone Registry
config :incant,
registry: [env: "HOSTKIT_RPC_BINDINGS"]Binding-path environment variable used by the standalone registry.
Admin Root Options
Repo
use Incant.Admin, repo: MyApp.RepoDefault repo for inferred and resource-backed surfaces.
Theme
use Incant.Admin, theme: MyApp.Admin.Themes.DefaultTheme metadata module.
Policy
use Incant.Admin, policy: MyApp.Admin.PolicyDefault authorization and scoping policy.
Actor Assign
use Incant.Admin, actor_assign: :current_scopeLiveView assign containing the actor.
Actor Callback
use Incant.Admin,
actor: {MyApp.Admin.Actor, :from_assigns}Custom extraction callback receiving LiveView assigns.
Naming
use Incant.Admin,
naming: [terms: %{openai: "OpenAI", llm: "LLM"}]Vocabulary for inferred titles, labels, options, badges, and known data terms.
Service Identity
use Incant.Admin,
service: :billing,
version: "1"Stable identity for portable service contracts.
RPC
use Incant.Admin, rpc: trueExposes standard Incant service operations through SafeRPC adapter metadata.
Surface Registration
Resource
resource MyApp.Admin.Resources.ProductRegisters an explicit resource module.
Expose Schema
expose MyApp.Catalog.ProductUses a conventional resource override when present, otherwise infers a schema-backed resource.
Dashboard
dashboard MyApp.Admin.Dashboards.OperationsDataset
dataset MyApp.Admin.Datasets.SalesResource Options
Schema and Repo
use Incant.Resource,
schema: MyApp.Catalog.Product,
repo: MyApp.RepoBase Query Callback
use Incant.Resource,
schema: MyApp.Catalog.Product,
repo: MyApp.Repo
query &MyApp.Admin.Queries.products/2Returns the base queryable before policy scope, search, filters, sorting, and pagination are applied.
Custom Index and Read
use Incant.Resource,
title: "Product Health"
index &MyApp.Admin.Products.index/2
read &MyApp.Admin.Products.read/2Application-owned callbacks for custom storage, projections, or in-memory rows.
Local Policy
use Incant.Resource,
policy: MyApp.Admin.Policies.CatalogOverrides the root policy for the surface.
Table Options
Column
column :name,
label: "Product",
link: true,
sortable: true,
format: nilBadge
column :status, as: :badgeUses naming vocabulary for enum-style display.
Search
search [:name, :email]Filter
filter :status, :select,
options: [:draft, :active, :archived]Multi-Select Filter
filter :provider, :multi_select,
options: [:openai, :anthropic, :google]Date-Range Filter
filter :inserted_at, :date_rangeRow Action
action :archive,
callback: &MyApp.Catalog.archive/2,
confirm: "Archive this product?",
destructive: trueBulk Action
actions do
bulk :publish,
callback: &MyApp.Catalog.publish_many/2
endForm Options
Text Field
field :nameSelect Field
field :status, :select,
options: [:draft, :active, :archived]Textarea
field :description, :textareaBoolean
field :featured, :booleanNumber
field :position, :numberDate
field :published_on, :dateHidden
field :account_id, :hiddenDashboard Options
Variable
var :range, :date_range,
default: {:last, 24, :hours}Supported built-in controls include :date_range, :select, :multi_select, :boolean, :number, :date, hidden, and text-like controls.
Grid
grid columns: 12, row_height: 8 do
# widgets
endStat
stat :requests,
span: 3,
label: "Requests",
format: :compact_number,
query: &MyApp.Metrics.requests/2Timeseries
timeseries :requests_over_time,
span: 8,
query: &MyApp.Metrics.timeline/2Table Widget
table :recent_failures,
span: 4,
query: &MyApp.Metrics.failures/2 do
column :provider
column :latency_ms, format: :duration_ms
column :cost_usd, format: :money
endChart
chart :cost_over_time, :line, span: 8 do
dataset MyApp.Admin.Datasets.Usage
x :timestamp, bucket: :hour
y :cost_usd
series :provider
endFormats
Money
format: :moneyUSD display such as $1,234.50. :currency is an alias.
Number
format: :numberDelimited integer/decimal display.
Compact Number
format: :compact_numberExamples: 12.4k, 1.4M, 2.1B.
Duration
format: :duration_msTreats the value as milliseconds and displays 240ms, 1.8s, 2.4m, or 1.2h.
Date and Time
format: :datetime
format: :date
format: :timeRelative Time
format: :relativeExamples: 45s ago, 3h ago, in 2m.
Percent
format: :percentTreats 0.125 as 12.5%.
Boolean
format: :booleanDisplays Yes or No.
Identifier
format: :idShortens long string identifiers to the first eight characters plus an ellipsis. Full values remain available to adapter tooltips where supported.
Volt Assets
Resolve Dependencies
config :volt,
resolve_dirs: ["deps"]Mount Embedded Behavior
import { mountIncant } from "incant"
mountIncant()Standalone Entry
import "incant/standalone"Creates the standalone LiveSocket and mounts Incant behavior.
Tailwind Source
@source "../deps/incant/lib";Standalone Environment
Serve
INCANT_SERVE=trueEnables the bundled endpoint in production.
HTTP Address
INCANT_HTTP_IP=127.0.0.1
INCANT_HTTP_PORT=4000Invalid IP values fall back to loopback.
Secret Key Base
INCANT_SECRET_KEY_BASE=...Required when standalone serving is enabled in production.
LiveView Signing Salt
INCANT_LIVE_VIEW_SIGNING_SALT=...Standalone LiveView signing salt.
Binding Path
HOSTKIT_RPC_BINDINGS=/run/incant/rpc.etfTrusted ETF registry-binding file.
Binding Variable Name
INCANT_RPC_BINDINGS_ENV=HOSTKIT_RPC_BINDINGSChanges which environment variable contains the binding path.