# Lavash v0.3.0-rc.2 - Table of Contents

Declarative state management for Phoenix LiveView, built for Ash Framework

## Pages

- [Lavash](readme.md)
- [Changelog](changelog.md)

## Modules

- [Lavash](Lavash.md): Reactive state management for Phoenix LiveView.
- [Lavash.Action.Runtime](Lavash.Action.Runtime.md): Shared action execution runtime for both LiveView and Component.
- [Lavash.Actions.Action](Lavash.Actions.Action.md): An action that transforms state in response to events.
- [Lavash.Actions.Effect](Lavash.Actions.Effect.md): A side effect
- [Lavash.Actions.Flash](Lavash.Actions.Flash.md): A flash message operation within an action.
- [Lavash.Actions.Invoke](Lavash.Actions.Invoke.md): Invokes an action on a child Lavash component.
- [Lavash.Actions.MapBy](Lavash.Actions.MapBy.md): Maps over an array field, finding items by a key field and applying a transformation.
- [Lavash.Actions.Navigate](Lavash.Actions.Navigate.md): A navigation operation within an action.
- [Lavash.Actions.Run](Lavash.Actions.Run.md): Executes a function that returns updated assigns.
- [Lavash.Actions.Set](Lavash.Actions.Set.md): Sets a field to a value.
- [Lavash.Actions.Submit](Lavash.Actions.Submit.md): An async form submission within an action.
- [Lavash.Application](Lavash.Application.md): OTP Application for Lavash.
- [Lavash.ChipSet](Lavash.ChipSet.md): A self-contained chip set component for multi-select filtering.
- [Lavash.Component.Calculate](Lavash.Component.Calculate.md): A calculated field computed from state using a reactive expression.
- [Lavash.Component.Compiler](Lavash.Component.Compiler.md): Runtime utilities for Lavash Component compilation.
- [Lavash.Component.CompilerHelpers](Lavash.Component.CompilerHelpers.md): Shared compiler utilities for Lavash components.

- [Lavash.Component.Dsl](Lavash.Component.Dsl.md): The Spark DSL extension for Lavash Components.
- [Lavash.Component.Helpers](Lavash.Component.Helpers.md): Helper functions for using Lavash components in LiveViews.

- [Lavash.Component.JsGenerator](Lavash.Component.JsGenerator.md): Transpiles parsed HEEx template nodes to JavaScript template literal strings.
- [Lavash.Component.OptimisticAction](Lavash.Component.OptimisticAction.md): An optimistic action that generates both client JS and server handlers.
- [Lavash.Component.Prop](Lavash.Component.Prop.md): A prop passed from the parent component.
- [Lavash.Component.Render](Lavash.Component.Render.md): A render function for LiveViews and Components.
- [Lavash.Component.Runtime](Lavash.Component.Runtime.md): Runtime implementation for Lavash Components.
- [Lavash.Component.State](Lavash.Component.State.md): A state field that connects component state to parent state.
- [Lavash.Component.Template](Lavash.Component.Template.md): DEPRECATED: Use Lavash.Component.Render instead.
- [Lavash.Component.Transformers.AnalyzeTemplate](Lavash.Component.Transformers.AnalyzeTemplate.md): Analyzes pre-tokenized template tokens for optimistic derives.
- [Lavash.Component.Transformers.CompileComponent](Lavash.Component.Transformers.CompileComponent.md): Compiles component template and generates all LiveComponent callbacks.
- [Lavash.Component.Transformers.TokenizeTemplate](Lavash.Component.Transformers.TokenizeTemplate.md): Tokenizes the template source string into HTML tokens.
- [Lavash.Components.SyncedToggle](Lavash.Components.SyncedToggle.md): Optimistic toggle switch component.
- [Lavash.Components.TagEditor](Lavash.Components.TagEditor.md): Optimistic tag input component.
- [Lavash.Derived.Field](Lavash.Derived.Field.md): A derived state field.
- [Lavash.Derived.Form](Lavash.Derived.Form.md): A declarative form definition in the derived section.
- [Lavash.Dsl.CommonEntities](Lavash.Dsl.CommonEntities.md): Shared DSL entity definitions used by both Lavash.Dsl (LiveView) and Lavash.Component.Dsl.
- [Lavash.Dsl.Graph](Lavash.Dsl.Graph.md): Builds and caches a `Lavash.Rx.Graph` from DSL module metadata.
- [Lavash.DslHelpers](Lavash.DslHelpers.md): Helper functions for use in Lavash DSL declarations.
- [Lavash.ExtendErrors](Lavash.ExtendErrors.md): Extends auto-generated form field errors with custom error checks.
- [Lavash.ExtendErrors.Error](Lavash.ExtendErrors.Error.md): A single custom error check within extend_errors.
- [Lavash.Form](Lavash.Form.md): A wrapper around Ash.Changeset that provides both form rendering and submission.
- [Lavash.Form.ConstraintTranspiler](Lavash.Form.ConstraintTranspiler.md): Transpiles Ash resource constraints to rx() expressions for client-side validation.
- [Lavash.Form.Runtime](Lavash.Form.Runtime.md): Shared form handling runtime for both LiveView and Component.
- [Lavash.Form.Section](Lavash.Form.Section.md): Struct representing a top-level form declaration.
- [Lavash.Form.Step](Lavash.Form.Step.md): DSL entity for a form step that creates an AshPhoenix.Form.
- [Lavash.Form.ValidationJs](Lavash.Form.ValidationJs.md): Generates JavaScript for form field validation and error checking.
- [Lavash.Form.ValidationTranspiler](Lavash.Form.ValidationTranspiler.md): Transpiles Ash resource validations (from `validations do` block) to client-side validation.
- [Lavash.JSON](Lavash.JSON.md): JSON encoding utilities for Lavash optimistic state.
- [Lavash.LiveView.Compiler](Lavash.LiveView.Compiler.md): Utility functions for LiveView compilation.
- [Lavash.LiveView.Components](Lavash.LiveView.Components.md): Lavash form components with built-in optimistic updates.
- [Lavash.LiveView.Explicit](Lavash.LiveView.Explicit.md): Non-DSL entry point for using the Lavash reactive graph from a plain
Phoenix.LiveView.
- [Lavash.LiveView.Helpers](Lavash.LiveView.Helpers.md): Helper functions available in Lavash LiveViews.

- [Lavash.LiveView.Runtime](Lavash.LiveView.Runtime.md): Runtime implementation for Lavash LiveViews.
- [Lavash.LiveView.Transformers.CompileLiveView](Lavash.LiveView.Transformers.CompileLiveView.md): Compiles LiveView template and generates all LiveView callbacks.
- [Lavash.Optimistic.ActionJs](Lavash.Optimistic.ActionJs.md): Shared action analysis and JS generation for optimistic updates.
- [Lavash.Optimistic.ActionMacro](Lavash.Optimistic.ActionMacro.md): Macro for defining optimistic actions that run on both client and server.
- [Lavash.Optimistic.Macros](Lavash.Optimistic.Macros.md): Macros for optimistic actions.
- [Lavash.Optimistic.Transformers.ExpandAnimatedStates](Lavash.Optimistic.Transformers.ExpandAnimatedStates.md): Spark transformer that expands animated state fields into phase tracking state and calculations.
- [Lavash.Optimistic.Transformers.ExpandDefrx](Lavash.Optimistic.Transformers.ExpandDefrx.md): Spark transformer that expands defrx function calls in rx expressions.
- [Lavash.Optimistic.Transformers.ExtractColocatedJs](Lavash.Optimistic.Transformers.ExtractColocatedJs.md): Extracts generated optimistic JS to colocated files for esbuild bundling.
- [Lavash.Overlay.Flyover.Dsl](Lavash.Overlay.Flyover.Dsl.md): Spark DSL extension for flyover (slideover) behavior.
- [Lavash.Overlay.Flyover.Helpers](Lavash.Overlay.Flyover.Helpers.md): Helper components for flyover (slideover) rendering.
- [Lavash.Overlay.Flyover.RenderGenerator](Lavash.Overlay.Flyover.RenderGenerator.md): Generates the render/1 function for flyover components.
- [Lavash.Overlay.Flyover.Transformers.GenerateRender](Lavash.Overlay.Flyover.Transformers.GenerateRender.md): Transformer that generates the render/1 function for flyover components.
- [Lavash.Overlay.Flyover.Transformers.InjectState](Lavash.Overlay.Flyover.Transformers.InjectState.md): Transformer that injects flyover state and actions into a Lavash Component.
- [Lavash.Overlay.Modal.RenderGenerator](Lavash.Overlay.Modal.RenderGenerator.md): Generates the render/1 function for modal components.
- [Lavash.Overlay.Modal.Transformers.GenerateRender](Lavash.Overlay.Modal.Transformers.GenerateRender.md): Transformer that generates the render/1 function for modal components.
- [Lavash.Overlay.Modal.Transformers.InjectState](Lavash.Overlay.Modal.Transformers.InjectState.md): Transformer that injects modal state and actions into a Lavash Component.
- [Lavash.Overlay.RenderGenerator](Lavash.Overlay.RenderGenerator.md): Behaviour for overlay render generators.
- [Lavash.Reactive](Lavash.Reactive.md): Reactive state management for Phoenix LiveViews.
- [Lavash.Reactive.GraphMacro](Lavash.Reactive.GraphMacro.md): Macro for defining reactive graphs with client-side JS generation.
- [Lavash.Read](Lavash.Read.md): A read step that loads an Ash resource.
- [Lavash.Read.Argument](Lavash.Read.Argument.md): An argument override for a read action.
- [Lavash.Render](Lavash.Render.md): A render function declaration.
- [Lavash.Rx](Lavash.Rx.md): A reactive expression that captures AST for isomorphic execution.
- [Lavash.Rx.Cache](Lavash.Rx.Cache.md): Module-scoped node-global cache for compiled `rx()` ASTs.
- [Lavash.Rx.Functions](Lavash.Rx.Functions.md): Module for defining reusable reactive functions that can be imported into LiveViews.
- [Lavash.Rx.Graph](Lavash.Rx.Graph.md): A precomputed reactive dependency graph.
- [Lavash.Rx.String](Lavash.Rx.String.md): String utility functions that transpile to JavaScript.
- [Lavash.Rx.Transpiler](Lavash.Rx.Transpiler.md): Translates Elixir expressions to JavaScript.
- [Lavash.Sigil](Lavash.Sigil.md): The `~L` sigil for Lavash HEEx templates.
- [Lavash.SparkHeex](Lavash.SparkHeex.md): Spike: a Spark DSL extension that treats HEEx templates as a first-class
DSL element, not as opaque sigil contents inside a function body.
- [Lavash.SparkHeex.TemplateMacro](Lavash.SparkHeex.TemplateMacro.md): The `template do ~H"..."  end` macro.
- [Lavash.SparkHeex.Transformers.CompileTemplate](Lavash.SparkHeex.Transformers.CompileTemplate.md): Compiles the HEEx template source into a `render/1` function on the
using module. The function takes an assigns map and returns a
`%Phoenix.LiveView.Rendered{}`, identical in shape to what `~H` produces
inside a regular Phoenix.Component.
- [Lavash.SparkHeex.Transformers.IngestTemplate](Lavash.SparkHeex.Transformers.IngestTemplate.md): Reads the `@__lavash_heex_template__` module attribute (set by the
`template` macro) and persists it into the DSL state so subsequent
transformers can inspect it.
- [Lavash.SparkHeex.Transformers.ValidateActionParams](Lavash.SparkHeex.Transformers.ValidateActionParams.md): Per-element cross-check between `phx-value-*` attributes and the
declared params on the corresponding `action`.
- [Lavash.SparkHeex.Transformers.ValidateEvents](Lavash.SparkHeex.Transformers.ValidateEvents.md): Cross-validates the tokenized HEEx template against declared `action`
entities.
- [Lavash.SparkHeex.Transformers.ValidateTemplate](Lavash.SparkHeex.Transformers.ValidateTemplate.md): Demonstrates the core spike value: the template is now a first-class DSL
citizen, so we can cross-validate it against other DSL entities at DSL
build time (i.e. inside the Spark transformer pipeline, not in a
bolted-on post-compile pass).
- [Lavash.State.EphemeralField](Lavash.State.EphemeralField.md): An ephemeral state field
- [Lavash.State.Field](Lavash.State.Field.md): A mutable state field from an external source.
- [Lavash.State.FormField](Lavash.State.FormField.md): Represents a form binding that syncs DOM form params to ephemeral state.
- [Lavash.State.SocketField](Lavash.State.SocketField.md): A socket state field.
- [Lavash.State.UrlField](Lavash.State.UrlField.md): A URL-backed state field
- [Lavash.TagEngine](Lavash.TagEngine.md): Thin wrapper around `Phoenix.LiveView.TagEngine.{Parser, Compiler}`.
- [Lavash.Template](Lavash.Template.md): Utilities for parsing HEEx templates into a small `:element` tree.
- [Lavash.Template.ASTTransformer](Lavash.Template.ASTTransformer.md): Transforms compiled HEEx template AST to inject Lavash-specific attributes.
- [Lavash.Template.Compiled](Lavash.Template.Compiled.md): Represents a compiled Lavash template with source preservation.
- [Lavash.Template.RenderMacro](Lavash.Template.RenderMacro.md): Macro for defining render functions in Lavash LiveViews and Components.
- [Lavash.Template.TokenTransformer](Lavash.Template.TokenTransformer.md): Unified token-tree transformer for Lavash templates.
- [Lavash.ToggleChip](Lavash.ToggleChip.md): A self-contained toggle chip component for boolean state.
- [Lavash.TokenTransformer](Lavash.TokenTransformer.md): Behaviour for transforming HEEx tokens before they are processed by TagEngine.
- [Lavash.Transformers.ExpandFields](Lavash.Transformers.ExpandFields.md): Spark transformer that expands all DSL entities (reads, forms, calculations,
explicit derives, multi_selects, toggles) into field specs at compile time.

- Core
  - [Lavash.Component](Lavash.Component.md): Stateful Phoenix LiveComponents with the same DSL as `Lavash.LiveView`.
  - [Lavash.Dsl](Lavash.Dsl.md): The Spark DSL extension for Lavash LiveViews.
  - [Lavash.LiveView](Lavash.LiveView.md): Use this module to create a Lavash-powered LiveView.

- State Management
  - [Lavash.Assigns](Lavash.Assigns.md): Projects metadata into socket assigns.
  - [Lavash.Graph](Lavash.Graph.md): Pure graph algorithms for dependency graphs.
  - [Lavash.Socket](Lavash.Socket.md): Helpers for accessing Lavash private socket data.
  - [Lavash.State](Lavash.State.md): State hydration and management.

- Optimistic Updates
  - [Lavash.Optimistic](Lavash.Optimistic.md): Namespace module for Lavash's optimistic update infrastructure.

- Overlays
  - [Lavash.Overlay](Lavash.Overlay.md): Overlay components for Lavash - modals, slideovers, and other layered UI.
  - [Lavash.Overlay.Modal](Lavash.Overlay.Modal.md): Modal behavior plugin for Lavash Components.
  - [Lavash.Overlay.Modal.Dsl](Lavash.Overlay.Modal.Dsl.md): Spark DSL extension for modal behavior.
  - [Lavash.Overlay.Modal.Helpers](Lavash.Overlay.Modal.Helpers.md): Helper components for modal rendering.

- PubSub
  - [Lavash.PubSub](Lavash.PubSub.md): PubSub integration for cross-process resource invalidation.
  - [Lavash.Resource](Lavash.Resource.md): Ash extension for Lavash resource configuration.

- Types
  - [Lavash.Type](Lavash.Type.md): Behaviour for bidirectional type conversion between URL strings and Elixir values.

- Exceptions
  - [Lavash.State.MissingRequiredFieldError](Lavash.State.MissingRequiredFieldError.md): Raised when a `from: :url, required: true` state field is absent from the URL
on mount or handle_params. Carries the offending field name so callers
(error pages, telemetry, etc.) can pattern-match.

