Arizona is a modern Erlang web framework that delivers real-time interactivity with the rock-solid reliability of the BEAM virtual machine.
Arizona is currently in active development. This framework is experimental
and not yet ready for production use.
Follow our progress and contribute at GitHub
.
Built-in PubSub system enables real-time updates across connected clients with automatic DOM synchronization.
Built on Erlang/OTP, Arizona inherits the legendary fault-tolerance, concurrency, and performance of the BEAM virtual machine.
Clean template syntax, hot code reloading, and comprehensive development tools make building web applications a joy.
-module(counter).
-behaviour(arizona_stateful).
-compile({parse_transform, arizona_parse_transform}).
-export([mount/1, render/1, handle_event/3]).
mount(Bindings) ->
arizona_stateful:new(?MODULE, Bindings#{
count => maps:get(count, Bindings, 0)
}).
render(Bindings) ->
arizona_template:from_string(~"""
<div class="text-center">
<span class="text-4xl font-bold">
{arizona_template:get_binding(count, Bindings)}
</span>
<button
class="btn-primary"
onclick="arizona.sendEventTo(
'{arizona_template:get_binding(id, Bindings)}',
'increment'
)"
>
+
</button>
</div>
""").
handle_event(~"increment", _Params, State) ->
Count = arizona_stateful:get_binding(count, State),
UpdatedState = arizona_stateful:put_binding(count, Count + 1, State),
{[], UpdatedState}.
Interactive components you can actually understand. No macros, no magic, no tears.