# `A2UI.Action`
[🔗](https://github.com/23min/ex_a2ui/blob/main/lib/a2ui/action.ex#L1)

An action triggered by user interaction with an A2UI component.

Actions have a name and optional context bindings that resolve against
the data model when the action fires.

## Examples

    # Simple action
    %A2UI.Action{name: "refresh"}

    # Action with context
    %A2UI.Action{name: "delete_item", context: %{
      "item_id" => %A2UI.BoundValue{path: "/selected/id"}
    }}

# `t`

```elixir
@type t() :: %A2UI.Action{
  context: %{optional(String.t()) =&gt; A2UI.BoundValue.t()} | nil,
  name: String.t()
}
```

# `new`

```elixir
@spec new(String.t()) :: t()
```

Creates a simple action with no context.

# `new`

```elixir
@spec new(String.t(), map()) :: t()
```

Creates an action with context bindings.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
