All Projects → thoughtbot → Formulator

thoughtbot / Formulator

Licence: mit
A form library for Phoenix

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Formulator

Authex
Authex is an opinionated JWT authentication and authorization library for Elixir.
Stars: ✭ 73 (-17.98%)
Mutual labels:  phoenix
Pow
Robust, modular, and extendable user authentication system
Stars: ✭ 1,213 (+1262.92%)
Mutual labels:  phoenix
Filterable
Filtering from incoming params in Elixir/Ecto/Phoenix with easy to use DSL.
Stars: ✭ 83 (-6.74%)
Mutual labels:  phoenix
Expug
Pug templates for Elixir
Stars: ✭ 74 (-16.85%)
Mutual labels:  phoenix
Mobx React Form Demo
Demo of MobX React Form
Stars: ✭ 78 (-12.36%)
Mutual labels:  form
Polymorphic embed
Polymorphic embeds in Ecto
Stars: ✭ 80 (-10.11%)
Mutual labels:  phoenix
Ecto morph
morph your Ecto capabilities into the s t r a t o s p h e r e !
Stars: ✭ 72 (-19.1%)
Mutual labels:  phoenix
Mentat
scalable group chat with tags and pretty good privacy.
Stars: ✭ 89 (+0%)
Mutual labels:  phoenix
Formium
The headless form builder for the modern web.
Stars: ✭ 78 (-12.36%)
Mutual labels:  form
React Native Merlin
🧙 Simple web-like forms in react native.
Stars: ✭ 83 (-6.74%)
Mutual labels:  form
Verk web
A dashboard for the job processing system that just verks! 🧛‍
Stars: ✭ 75 (-15.73%)
Mutual labels:  phoenix
Normform
Normform: A tiny CSS plugin to make your web forms beautiful again
Stars: ✭ 78 (-12.36%)
Mutual labels:  form
Phoenix react playground
An example setup for a Phoenix+React project with sensible defaults.
Stars: ✭ 80 (-10.11%)
Mutual labels:  phoenix
Just Validate
Lightweight (~4,5kb gzip) form validation in Javascript Vanilla, without dependencies, with customizable rules (including remote validation), customizable messages and customizable submit form with ajax helper.
Stars: ✭ 74 (-16.85%)
Mutual labels:  form
Phoenix gon
🔥 Phoenix variables in your JavaScript without headache.
Stars: ✭ 84 (-5.62%)
Mutual labels:  phoenix
Phoenixengine
please update from this place https://gitee.com/manykit/PHOENIXEngine.git
Stars: ✭ 71 (-20.22%)
Mutual labels:  phoenix
Vue Rawmodel
RawModel.js plugin for Vue.js v2. Form validation has never been easier!
Stars: ✭ 79 (-11.24%)
Mutual labels:  form
Memento
Collect saved items from different sources around the web
Stars: ✭ 89 (+0%)
Mutual labels:  phoenix
Antd Jsonschema Form
Aother ui implement for react-jsonschema-form
Stars: ✭ 86 (-3.37%)
Mutual labels:  form
Legit
input validation framework
Stars: ✭ 81 (-8.99%)
Mutual labels:  form

CircleCI

Formulator

Formulator is part of the thoughtbot Elixir family of projects.

This README follows master, which may not be the currently published version. Here are the docs for the latest published version of Formulator

Usage

Formulator is a library for Phoenix to give you:

  • A label for your input, based on the attribute name
  • An error label
  • A class around the input if there is an error for the attribute. This allows you to easily style inputs that have errors.

You can replace the following:

  <%= label form, :name %>
  <%= text_input form, :name %>
  <%= error_tag form, :name %>

with this:

  <%= input form, :name %>

You also get the added benefit of having a class of has-error on the input when there is an error associated with the attribute.

By default, Formulator assumes that you want a standard text input but if you prefer, you can also specify the input type:

  <%= input form, :description, as: :textarea %>
  <%= input form, :count, as: :number %>
  <%= input form, :email_address, as: :email %>

See Formulator.input/3 for more examples.

Installation

Add formulator to your list of dependencies in mix.exs:

  def deps do
    [
      {:formulator, "~> 0.2.0"},
    ]
  end
  $ mix deps.get

Formulator needs to know what module to use for the translate_error/1 function. This is commonly defined by Phoenix either in web/views/error_helpers.ex or web/gettext.ex. Formulator can also be set to not validate by default; individual input options override the application config.

  # config/config.exs
  config :formulator,
    translate_error_module: YourAppName.ErrorHelpers,
    validate: false, # defaults to true
    validate_regex: false,  # defaults to true
    wrapper_class: "input-set"  # defaults to nil

You can import the package into all your views or individually as it makes sense:

  # web/web.ex
  def view do
    quote do
      ...
      import Formulator
      ...
    end
  end

Releases

To create a new release, use the bin/release script. You must provide the current version number and the new version number: bin/release 0.2 0.3.

If you need hex permissions, please ask someone in the thoughtbot #elixir slack channel.

This will create a new commit with the updated fields and publish to hex.

Please be sure to follow Semver when creating a new release

Contributing

See the CONTRIBUTING document. Thank you, contributors!

License

Formulator is Copyright (c) 2017 thoughtbot, inc. It is free software, and may be redistributed under the terms specified in the LICENSE file.

About

thoughtbot

Formulator is maintained and funded by thoughtbot, inc. The names and logos for thoughtbot are trademarks of thoughtbot, inc.

We love open source software, Elixir, and Phoenix. See our other Elixir projects, or hire our Elixir/Phoenix development team to design, develop, and grow your product.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].