AshFormBuilder.FormRenderer
(AshFormBuilder v0.4.0)
View Source
Phoenix function components that render form entities.
Structural rendering (entity iteration, nested inputs_for loops,
add/remove buttons) lives here. Per-field widget rendering is
delegated to a theme module.
The theme is resolved in this order:
- The
:themeassign passed toform_fields/1(preferred — set byAshFormBuilder.FormComponentfrom the per-form DSL). - The
:ash_form_builder, :themeApplication config. AshFormBuilder.Themes.Default.
Summary
Functions
Renders all entities (fields and nested forms) for a form.
Renders a nested relationship form block with add/remove buttons.
Functions
Renders all entities (fields and nested forms) for a form.
Required assigns:
:form—Phoenix.HTML.Form:entities— list ofFieldandNestedFormstructs:target— LiveComponent target (@myself):wrapper_class— CSS class for the wrapper div
Optional:
:theme— theme module (overrides Application env):theme_opts— keyword list of theme-specific options (:accent,:transitions, etc.):uploads— LiveView upload configs map
Attributes
form(Phoenix.HTML.Form) (required)entities(:list) (required)target(:any) - Defaults tonil.wrapper_class(:string) - Defaults to"space-y-4".theme(:atom) - Defaults tonil.theme_opts(:list) - Defaults to[].uploads(:map) - Defaults to%{}.
Renders a nested relationship form block with add/remove buttons.
Attributes
form(Phoenix.HTML.Form) (required)nested(:any) (required)target(:any) - Defaults tonil.theme(:atom) - Defaults tonil.theme_opts(:list) - Defaults to[].