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.LiveView

Default semantic UI adapter.

Density

config :incant, density: :compact

Default adapter density. Themes may support :compact, :comfortable, and :spacious.

Per-Admin UI

config :incant, MyApp.Admin,
  density: :comfortable

Overrides 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?: true

Starts 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.Repo

Default repo for inferred and resource-backed surfaces.

Theme

use Incant.Admin, theme: MyApp.Admin.Themes.Default

Theme metadata module.

Policy

use Incant.Admin, policy: MyApp.Admin.Policy

Default authorization and scoping policy.

Actor Assign

use Incant.Admin, actor_assign: :current_scope

LiveView 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: true

Exposes standard Incant service operations through SafeRPC adapter metadata.

Surface Registration

Resource

resource MyApp.Admin.Resources.Product

Registers an explicit resource module.

Expose Schema

expose MyApp.Catalog.Product

Uses a conventional resource override when present, otherwise infers a schema-backed resource.

Dashboard

dashboard MyApp.Admin.Dashboards.Operations

Dataset

dataset MyApp.Admin.Datasets.Sales

Resource Options

Schema and Repo

use Incant.Resource,
  schema: MyApp.Catalog.Product,
  repo: MyApp.Repo

Base Query Callback

use Incant.Resource,
  schema: MyApp.Catalog.Product,
  repo: MyApp.Repo

query &MyApp.Admin.Queries.products/2

Returns 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/2

Application-owned callbacks for custom storage, projections, or in-memory rows.

Local Policy

use Incant.Resource,
  policy: MyApp.Admin.Policies.Catalog

Overrides the root policy for the surface.

Table Options

Column

column :name,
  label: "Product",
  link: true,
  sortable: true,
  format: nil

Badge

column :status, as: :badge

Uses naming vocabulary for enum-style display.

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_range

Row Action

action :archive,
  callback: &MyApp.Catalog.archive/2,
  confirm: "Archive this product?",
  destructive: true

Bulk Action

actions do
  bulk :publish,
    callback: &MyApp.Catalog.publish_many/2
end

Form Options

Text Field

field :name

Select Field

field :status, :select,
  options: [:draft, :active, :archived]

Textarea

field :description, :textarea

Boolean

field :featured, :boolean

Number

field :position, :number

Date

field :published_on, :date

Hidden

field :account_id, :hidden

Dashboard 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
end

Stat

stat :requests,
  span: 3,
  label: "Requests",
  format: :compact_number,
  query: &MyApp.Metrics.requests/2

Timeseries

timeseries :requests_over_time,
  span: 8,
  query: &MyApp.Metrics.timeline/2

Table 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
end

Chart

chart :cost_over_time, :line, span: 8 do
  dataset MyApp.Admin.Datasets.Usage
  x :timestamp, bucket: :hour
  y :cost_usd
  series :provider
end

Formats

Money

format: :money

USD display such as $1,234.50. :currency is an alias.

Number

format: :number

Delimited integer/decimal display.

Compact Number

format: :compact_number

Examples: 12.4k, 1.4M, 2.1B.

Duration

format: :duration_ms

Treats the value as milliseconds and displays 240ms, 1.8s, 2.4m, or 1.2h.

Date and Time

format: :datetime
format: :date
format: :time

Relative Time

format: :relative

Examples: 45s ago, 3h ago, in 2m.

Percent

format: :percent

Treats 0.125 as 12.5%.

Boolean

format: :boolean

Displays Yes or No.

Identifier

format: :id

Shortens 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=true

Enables the bundled endpoint in production.

HTTP Address

INCANT_HTTP_IP=127.0.0.1
INCANT_HTTP_PORT=4000

Invalid 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.etf

Trusted ETF registry-binding file.

Binding Variable Name

INCANT_RPC_BINDINGS_ENV=HOSTKIT_RPC_BINDINGS

Changes which environment variable contains the binding path.