A set of useful extensions for the very popular Bootstrap framework.
This framework depends heavily on Bootstrap 3 and jQuery. Include the dependencies (jQuery 2.2.4 or newer, Bootstrap 3 js and css files) in your <head>
section and after them insert the following two lines to include Bootstrap-Extend:
Alternatively you can download the files on your local machine from my Github page and include them using a local path.
Note: I know that RawGit is not 100% reliable and that sometimes problems can occur, as well as the fact that using a hash might look kinda clumsy, but this is a free project and so far this seems like my best option.
This framework is all about custom CSS styles for commonly used elements and responsive and lightweight components. Most of these components complement Bootstrap's aesthetic or aim to deal with its shortcomings in one way or another. More components will be added regularly. Bootstrap-Extend aims to eventually fill the gap left by Bootstrap in certain areas, without the need to include each component individually, but rather provide people with a consistent set of elements all in one place.
If you want to get individual components instead of the whole thing, head over to my Github page, find the components you need and copy paste the corresponding SCSS and Javascript files. You will need to compile the SCSS files locally before you have a working CSS file that you can use.
Use the .btn-notice
class like any other button tag from Bootstrap. Inspired from the Bootstrap website's header colors.
Extend the functionality of your <input type="password">
fields by adding a button that toggles password display on or off. Simply add the .pwd
class to your field and the .pwd-toggle
class to a <span><span/>
element in the same .input-group
and users can now toggle password viewing on or off. When the form is submitted, the field will revert to type="password"
regardless of its current state for security reasons. Just be sure to use an <input type="submit">
element to submit your form.
Use the .switch
class only on <input type="checkbox">
or <input type="radio">
elements. Don't forget to add a <label>
after it and link it to the input's id
. There are two types of toggle switches, round and rectangular. Both types have seven flavours, similar to the classic Bootstrap buttons:
.switch-round-default
and .switch-rect-default
.switch-round-primary
and .switch-rect-primary
.switch-round-success
and .switch-rect-success
.switch-round-info
and .switch-rect-info
.switch-round-warning
and .switch-rect-warning
.switch-round-danger
and .switch-rect-danger
.switch-round-notice
and .switch-rect-notice
You can also add optional text labels to your toggle switches. There are three options of toggle switch text labels:
.switch-on-off
(Displays "ON" and "OFF").switch-io
(Displays the on and off symbols).switch-yes-no
(Displays "YES" and "NO")Original idea and implementation by callmenick.com.
Use the .lightbox-toggle
class on a link element surrounding an image element to create a lightbox that opens when you click on the image. Be sure to specify a unique id
for the image element. The lightbox will automatically resize to properly fit your browser's size and change its size accordingly to the browser when the window is resized. You can use the alt
attribute of the image to show a custom title in your lightbox, otherwise you can leave it blank to show the URL of the image.
Suggestion: Use this lightbox with Bootstrap's .thumbnail
class and/or in combination with tooltips to show your users that the images can be viewed in a lightbox.
Make your numeric inputs prettier by using the .spinner
class on an .input-group
with a text input element and two buttons. Comes in two styles: arrows (.spinner-up-down
class) and plus/minus (.spinner-plus-minus
class).
Bootstrap's Collapse is great. But if you are looking for a different style for your content toggle buttons, you can now use the .btn-toggle
class in combintion with a <label>
element to achieve that. All the functionality of the original Bootstrap component remains intact.
Use the .chkbox
class only on <input type="checkbox">
elements. Don't forget to add a <label>
after it and link it to the checkbox's id
. There are seven flavours of checkboxes, similar to the classic Bootstrap buttons:
.chkbox-default
.chkbox-primary
.chkbox-success
.chkbox-info
.chkbox-warning
.chkbox-danger
.chkbox-notice
You can also use the .chkbox-lg
, .chkbox-sm
and .chkbox-xs
classes to change the size of your checkboxes.
Use the .rdbtn
class only on <input type="radio">
elements. Don't forget to add a <label>
after it and link it to the radio button's id
. There are seven flavours of radio buttons, similar to the classic Bootstrap buttons:
.rdbtn-default
.rdbtn-primary
.rdbtn-success
.rdbtn-info
.rdbtn-warning
.rdbtn-danger
.rdbtn-notice
You can also use the .rdbtn-lg
, .rdbtn-sm
and .rdbtn-xs
classes to change the size of your radio buttons.
Use the .urd
class for unordered lists or the .ord
class for ordered lists in combination with one of the three styles (disc, circle and square). Apart from that, you can use the .urd-big
to make your unordered list bullets larger. There are 7 color combinations, along with the above options:
.urd-disc-default
, .urd-circle-default
and .urd-square-default
.urd-disc-primary
, .urd-circle-primary
and .urd-square-primary
.urd-disc-success
, .urd-circle-success
and .urd-square-success
.urd-disc-info
, .urd-circle-info
and .urd-square-info
.urd-disc-warning
, .urd-circle-warning
and .urd-square-warning
.urd-disc-danger
, .urd-circle-danger
and .urd-square-danger
.urd-disc-notice
, .urd-circle-notice
and .urd-square-notice
Similarly, you can use the classes for ordered lists by replacing .urd-
with .ord-
. Note that ordered lists using these classes only use the decimal
value for the list-style
attribute and different values will not be taken into account.
Use the .slct
class to give a new style to your <select>
elements. Note: this particular class might not work in older versions of Internet Explorer.