bh v0.0.16 Bh.Bh3.Button View Source

Twitter Bootstrap 3 button helpers for Phoenix.

Link to this section Summary

Functions

Generates complex button HTML markup.

Link to this section Functions

Generates complex button HTML markup.

Options

  • :context - context of the button. Allowed values are :default, :primary, :success, :info, :warning, :danger, :link. Default context is :default.

  • :id - id of the button.

  • :size - size of the button. Supported sizes: :large (alias :lg), :small (alias :sm) and :extra_small (alias :xs). By default the :size is not set (standard button size).

  • :layout - layout of the button. Allowed :layout value is :block. By default :layout value is not set (renders standard button layout).

  • :active - boolean. If true - button is rendered with active class, which gives appearance of the pressed button. Default is false.

  • :disabled - boolean. If true - button looks unclickable (faded). Default is false.

Examples

<%= bh_button "Button" %>
<button class="btn btn-default" type="button">Button</button>

You can pass only block of complex HTML without any options if needed.

<%= bh_button do %>
  <span>Some content and <b>bold words</b></span>
<%= end %>
<button class="btn btn-default" type="button">
  <span>Some content and <b>bold words</b></span>
</button>