Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kovpack/bh
Twitter Bootstrap 4 & Bootstrap 3 helpers for Phoenix.
https://github.com/kovpack/bh
bootstrap3 bootstrap4 elixir helper phoenix phoenix-framework
Last synced: 3 months ago
JSON representation
Twitter Bootstrap 4 & Bootstrap 3 helpers for Phoenix.
- Host: GitHub
- URL: https://github.com/kovpack/bh
- Owner: kovpack
- Created: 2016-07-03T18:48:44.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-11-03T00:01:19.000Z (about 5 years ago)
- Last Synced: 2024-09-28T16:20:52.530Z (3 months ago)
- Topics: bootstrap3, bootstrap4, elixir, helper, phoenix, phoenix-framework
- Language: Elixir
- Homepage: https://kovpack.github.io/bh/
- Size: 245 KB
- Stars: 20
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](https://github.com/Fullscreen/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](https://kovpack.github.io/bh/).Full API documentation is available on
[Hexdocs](https://hexdocs.pm/bh/api-reference.html).**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](https://hex.pm/packages/bh) and can be installed
as:- Add `:bh` of the needed version to the list of dependencies in `mix.exs`:
```
def deps do
[{:bh, "~> 0.0.16"}]
end
```- Use `use Bh` to import all **Bootstrap 4** helpers into needed view:
```
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
```- Now you can use helpers in your view like this:
```
<%= 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