{"id":29196952,"url":"https://github.com/beam-community/formulator","last_synced_at":"2025-12-12T00:10:49.415Z","repository":{"id":49303227,"uuid":"64764837","full_name":"beam-community/formulator","owner":"beam-community","description":"A form library for Phoenix","archived":false,"fork":false,"pushed_at":"2021-10-12T15:50:47.000Z","size":627,"stargazers_count":106,"open_issues_count":1,"forks_count":14,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-06-26T12:56:40.991Z","etag":null,"topics":["elixir","form","formulator","phoenix","thoughtbot"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beam-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-02T14:40:26.000Z","updated_at":"2024-10-01T19:42:42.000Z","dependencies_parsed_at":"2022-09-15T11:20:21.080Z","dependency_job_id":null,"html_url":"https://github.com/beam-community/formulator","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/beam-community/formulator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-community%2Fformulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-community%2Fformulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-community%2Fformulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-community%2Fformulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beam-community","download_url":"https://codeload.github.com/beam-community/formulator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-community%2Fformulator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263089424,"owners_count":23412307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","form","formulator","phoenix","thoughtbot"],"created_at":"2025-07-02T06:39:44.785Z","updated_at":"2025-12-12T00:10:49.381Z","avatar_url":"https://github.com/beam-community.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Formulator\n\n**Formulator is part of the [thoughtbot Elixir family][elixir-phoenix] of projects.**\n\nThis README follows master, which may not be the currently published version.\nHere are the [docs for the latest published version of Formulator](https://hexdocs.pm/formulator)\n\n## Usage\n\nFormulator is a library for Phoenix to give you:\n* A label for your input, based on the attribute name\n* An error label\n* A class around the input if there is an error for the attribute. This allows\n  you to easily style inputs that have errors.\n\nYou can replace the following:\n\n```elixir\n  \u003c%= label form, :name %\u003e\n  \u003c%= text_input form, :name %\u003e\n  \u003c%= error_tag form, :name %\u003e\n```\n\nwith this:\n\n```elixir\n  \u003c%= input form, :name %\u003e\n```\n\nYou also get the added benefit of having a class of `has-error` on the input\nwhen there is an error associated with the attribute.\n\nBy default, Formulator assumes that you want a standard text input but if you\nprefer, you can also specify the input type:\n\n```elixir\n  \u003c%= input form, :description, as: :textarea %\u003e\n  \u003c%= input form, :count, as: :number %\u003e\n  \u003c%= input form, :email_address, as: :email %\u003e\n```\n\nSee [Formulator.input/3](https://hexdocs.pm/formulator/Formulator.html#input/3) for more examples.\n\n### Installation\n\nAdd formulator to your list of dependencies in `mix.exs`:\n\n```elixir\n  def deps do\n    [\n      {:formulator, \"~\u003e 0.4.0\"},\n    ]\n  end\n```\n\n```bash\n  $ mix deps.get\n```\n\nFormulator needs to know what module to use for the `translate_error/1`\nfunction. This is commonly defined by Phoenix either in\n`web/views/error_helpers.ex` or `web/gettext.ex`. Formulator can also\nbe set to not validate by default; individual input options override\nthe application config.\n\n```elixir\n  # config/config.exs\n  config :formulator,\n    translate_error_module: YourAppName.ErrorHelpers,\n    validate: false, # defaults to true\n    validate_regex: false,  # defaults to true\n    wrapper_class: \"input-set\"  # defaults to nil\n```\n\nYou can import the package into all your views or individually as it makes\nsense:\n```elixir\n  # web/web.ex\n  def view do\n    quote do\n      ...\n      import Formulator\n      ...\n    end\n  end\n```\n\n## Releases\n\nTo create a new release, use the `bin/release` script. You must provide the\ncurrent version number and the new version number: `bin/release 0.2 0.3`.\n\nIf you need hex permissions, please ask someone in the thoughtbot #elixir slack\nchannel.\n\nThis will create a new commit with the updated fields and publish to hex.\n\nPlease be sure to follow [Semver] when creating a new release\n\n[Semver]: https://semver.org/\n\n## Contributing\n\nSee the [CONTRIBUTING] document.\nThank you, [contributors]!\n\n  [CONTRIBUTING]: https://github.com/thoughtbot/formulator/blob/master/CONTRIBUTING.md\n  [contributors]: https://github.com/thoughtbot/formulator/graphs/contributors\n\n## License\n\nFormulator is Copyright (c) 2017 thoughtbot, inc.\nIt is free software, and may be redistributed\nunder the terms specified in the [LICENSE] file.\n\n  [LICENSE]: https://github.com/thoughtbot/formulator/blob/master/LICENSE\n\n## About\n\n[![thoughtbot][thoughtbot-logo]][thoughtbot]\n\nFormulator is maintained and funded by thoughtbot, inc.\nThe names and logos for thoughtbot are trademarks of thoughtbot, inc.\n\nWe love open source software, Elixir, and Phoenix. See [our other Elixir\nprojects][elixir-phoenix], or [hire our Elixir/Phoenix development team][hire]\nto design, develop, and grow your product.\n\n  [thoughtbot]: https://thoughtbot.com?utm_source=github\n  [thoughtbot-logo]: http://presskit.thoughtbot.com/images/thoughtbot-logo-for-readmes.svg\n  [elixir-phoenix]: https://thoughtbot.com/services/elixir-phoenix?utm_source=github\n  [hire]: https://thoughtbot.com?utm_source=github\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeam-community%2Fformulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeam-community%2Fformulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeam-community%2Fformulator/lists"}