# `Minga.RenderModel.UI.Action`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga/render_model/ui/action.ex#L1)

Semantic UI action metadata shared by render-model surfaces.

Actions are declarative. They may name an editor action to execute when explicit input dispatches the action, but they never carry extension callbacks or arbitrary render-time code.

# `editor_action`

```elixir
@type editor_action() :: atom() | tuple() | nil
```

Editor action dispatched through `MingaEditor.Commands.execute/2`.

# `kind`

```elixir
@type kind() :: :primary | :secondary | :destructive | :link | :toggle
```

Semantic action style hint for frontends.

# `t`

```elixir
@type t() :: %Minga.RenderModel.UI.Action{
  confirm: String.t() | nil,
  editor_action: editor_action(),
  enabled?: boolean(),
  icon: String.t() | nil,
  id: String.t(),
  kind: kind(),
  label: String.t(),
  payload: map()
}
```

# `enabled?`

```elixir
@spec enabled?(t()) :: boolean()
```

Returns true when the action can be dispatched.

# `new`

```elixir
@spec new(t() | map() | keyword()) :: {:ok, t()} | {:error, term()}
```

Builds an action from a struct, map, or keyword list.

---

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