Form header — static title + description pair rendered above the fields, with optional icon and a custom HEEx render escape hatch.
Visibility gating (visible / restricted) follows the same access
conventions used by MishkaGervaz.Form.Entities.Field and
MishkaGervaz.Form.Entities.Group. Title and description accept
strings or zero-/one-arity functions, so they can render dynamic
content from the form state.
Example
layout do
header do
title "Account Permissions"
description "Configure what this account can access."
icon "hero-shield-check"
class "mb-6"
visible fn state -> state.mode == :update end
end
endSee MishkaGervaz.Form.Dsl.Layout for the surrounding section.
Summary
Types
@type t() :: %MishkaGervaz.Form.Entities.Header{ __spark_metadata__: map() | nil, class: String.t() | nil, description: String.t() | (-> String.t()) | (map() -> String.t()) | nil, extra: map(), icon: String.t() | nil, render: (map() -> Phoenix.LiveView.Rendered.t()) | (map(), map() -> Phoenix.LiveView.Rendered.t()) | nil, restricted: boolean() | (map() -> boolean()), title: String.t() | (-> String.t()) | (map() -> String.t()) | nil, visible: boolean() | (map() -> boolean()) }