Bh

Twitter Bootstrap 4 & Twitter Bootstrap 3 helpers for Phoenix.

This package is designed to minimize repetitive code and the amount of HTML markup in your project’s source code.

Package is greatly inspired by bh gem for Rails (so this package even took the same name, however, API is different so do not expect to find exactly the same stuff).

Real live examples can be found on the site of the Project.

Full API documentation is available on Hexdocs.

NOTE: Please, keep in mind, that Twitter Bootstrap source files are not included into the package and should be installed separately.

Installation

Package is available in Hex and can be installed as:

def deps do
  [{:bh, "~> 0.0.11"}]
end
defmodule YourApp.SomeView do
  use YourApp.Web, :view
  use Bh
end

If you want to use Bootstrap 3 helpers, you have to pass an extra option like this:

defmodule YourApp.SomeView do
  use YourApp.Web, :view
  use Bh, bootstrap: 3
end
<%= bh_label "Pill text", context: :success %>

NOTE: keep in mind, that Bootstrap 3 and Bootstrap 4 helpers can have different APIs and may be not compatible, so check documentation or live examples.

Licence

MIT