SmartForm
SmartForm is a hex package to make working with forms in Phoenix LiveView easy and simple while at the same time support complex forms.
Features
- field definitions and validations in the same spot
- working with nested data is a breeze
- non-trivial mappings between source data and the form data are supported
- partial validation
Example
# Define the form
defmodule Form do
use SmartForm
smart_form do
field :name, :string, validate: :required
end
end
# Using the formInstallation
The package can be installed by adding smart_form to your list of dependencies in mix.exs:
def deps do
[
{:smart_form, "~> 0.1.0"}
]
endDocumentation
API documentation is available at https://hexdocs.pm/smart_form.
Inspiration
SmartForm is inspired by Ecto itself as well as Ash Framework and Data Division.
License
Copyright (c) 2022, Jørgen Orehøj Erichsen
SmartForm source code is licensed under the MIT License.