# `MishkaGervaz.Form.Entities.Notice`
[🔗](https://github.com/mishka-group/mishka_gervaz/blob/v0.0.1-alpha.3/lib/mishka_gervaz/form/entities/notice.ex#L1)

Static form notice — alerts and banners with a known position,
validation binding, dismiss tracking, and master-only restriction.

A notice is declared statically and rendered dynamically: the
position, type, and binding are pinned at compile time, while
`visible` / `show_when` / `bind_to` decide whether to actually render
on each frame. Five visual types (`:info`, `:warning`, `:error`,
`:success`, `:neutral`) and a custom HEEx render escape hatch cover
the common cases.

## Positions

Atoms:
- `:form_top` - above the `<.form>` element.
- `:before_header` / `:after_header` - around the form header.
- `:before_groups` / `:before_fields` - before grouped/ungrouped field rows.
- `:before_submit` - above the submit/cancel row.
- `:form_bottom` - below the submit row but inside `<.form>`.
- `:form_footer` - below the form footer (last possible slot).

Tuples:
- `{:before_group, :group_name}` / `{:after_group, :group_name}`

## Bind to (dynamic activation)

- `:validation` - shown when `state.form_errors != []`.
- `:uploads` - shown when any registered upload has errors.
- `:dirty` - shown when `state.dirty? == true`.
- `nil` - no auto-binding; controlled solely by `visible`/`show_when`.

## Example

    layout do
      notice :read_only_banner do
        position :before_fields
        type :warning
        title "Read-Only Access"
        content "Your role can view but not modify these settings."
        icon "hero-lock-closed"
        visible fn state -> state.current_user.role == :viewer end
        restricted false
        dismissible false
      end

      notice :validation_summary do
        position :form_top
        type :error
        bind_to :validation
        title fn _state -> "Please fix the errors below" end
      end
    end

See `MishkaGervaz.Form.Dsl.Layout` for the surrounding section and
`MishkaGervaz.Form.Entities.Notice.Ui` for the `ui` sub-entity.

# `position`

```elixir
@type position() ::
  :form_top
  | :before_header
  | :after_header
  | :before_groups
  | :before_fields
  | :before_submit
  | :form_bottom
  | :form_footer
  | {:before_group, atom()}
  | {:after_group, atom()}
```

# `t`

```elixir
@type t() :: %MishkaGervaz.Form.Entities.Notice{
  __identifier__: atom() | nil,
  __spark_metadata__: map() | nil,
  bind_to: :validation | :uploads | :dirty | nil,
  content: String.t() | (-&gt; String.t()) | (map() -&gt; String.t()) | nil,
  dismissible: boolean(),
  icon: String.t() | nil,
  name: atom(),
  only_steps: [atom()] | nil,
  position: position(),
  render:
    (map() -&gt; Phoenix.LiveView.Rendered.t())
    | (map(), map() -&gt; Phoenix.LiveView.Rendered.t())
    | nil,
  restricted: boolean() | (map() -&gt; boolean()),
  show_when: (map() -&gt; boolean()) | nil,
  title: String.t() | (-&gt; String.t()) | (map() -&gt; String.t()) | nil,
  type: :info | :warning | :error | :success | :neutral,
  ui: MishkaGervaz.Form.Entities.Notice.Ui.t() | nil,
  visible: boolean() | (map() -&gt; boolean())
}
```

# `transform`

# `validate_position`

Validate a position value. Returns `:ok` or `{:error, reason}`.

---

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