Button component is an enhanced version of the standard HTML <
button
>
element. A button consists of text and/or an image that clearly communicates what action will occur when user clicks or touches it. Propeller button component provides various types of buttons, and allows user to add both display and click effects.
Bootstrap provides different classes for button based upon its purpose. For example - Include Primary Button to the code by adding .btn-primary
.
Propeller button consists of Bootstrap HTML structure with Propeller customized classes based on material design standards. Add .pmd-ripple-effect
followed by Bootstrap classes to get ripple effect to button.
Raised Button is used to give prominence to actions in a layouts with a lot of varying content. Include Raised Button to the code by adding .pmd-btn-raised
.
Flat Button is a text-only button and is general included in the dialogs and toolbars.
Include Flat Button to the code by adding .pmd-btn-flat
.
Outline Button is a button with a border rather that background color. It is generally used to define secondary action. Include Outline Button to the code by adding .btn-outline-*
.
Want Fancy larger or smaller button? Add .btn-lg
, .btn-sm
for additional sizes.
Create block level button—those that span the full width of a parent— by adding .btn-block
.
Floating Action Buttons also known as FAB buttons are used to display frequently used actions.
Include FAB Button to the code by adding .pmd-btn-fab
.
Include Raised Floating Action Button to the code by adding .pmd-btn-fab .pmd-btn-raised
.
Include Flat FAB Button to the code by adding .pmd-btn-fab .pmd-btn-flat
.
Include Outline FAB Button to the code by adding .pmd-btn-fab
with .btn-outline-*
.
Add .btn-lg
, .btn-sm
for additional sizes in Floating Action Buttons.
Group a series of buttons together on a single line with the button group by using .btn-group
class.
Combine sets of <div class="btn-group">
into a <div class="btn-toolbar">
for more complex components.
Use data-toggle="button"
attribute to create toggle buttons. For pre-toggling, add the .active
class manually and add aria-pressed="true"
to the button.
Set the toogle state for components like checkboxes and radio button groups by adding data-toggle="buttons"
and .btn-group-toggle
to the .btn-group
. For pre-toggling, add .active
class in the label
tag and checked
in the input
tag.
The Propeller CSS classes apply various predefined visual enhancements to the button. The table lists the available classes and their effects.
Propeller Class | Effect | Remark |
---|---|---|
.pmd-ripple-effect |
Supporting class which, when used with .btn adds a ripple effect to the button. |
Optional |
.pmd-btn-raised |
Supporting class which, when used with .btn makes the button look raised. |
Optional |
.pmd-btn-flat |
Supporting class which, when used with .btn makes the button flat. |
Optional |
.pmd-btn-fab |
Supporting class which, when used with .btn makes it circular. |
Optional |
Call the jQuery plugin to initialize the Button Ripple effect while fetching the data dynamically.
See here for more documentation on this.
Method | Description |
---|---|
$().button('toggle') |
Toggles push state. Gives the button the appearance that it has been activated. |
$().button('dispose') |
Destroys an element’s button. |