Skip to content

A custom select for @twitter bootstrap using button dropdown; originally by Silvio Moreto

Notifications You must be signed in to change notification settings

rivalex/bootstrap-select

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 

Repository files navigation

bootstrap-select

A custom select for @twitter bootstrap using button dropdown, designed to behave like regular Bootstrap selects; originally by Silvio Moreto and Ana Carolina. See an example.

Usage

Create your <select> with the .selectpicker class.

<select class="selectpicker">
  <option>Mustard</select>
  <option>Ketchup</select>
  <option>Barbecue</select>
</select>

Enable Bootstrap-Select via JavaScript:

$('.selectpicker').selectpicker();

Or just

$('select').selectpicker();

Options can be passed via data attributes or JavaScript.

$('.selectpicker').selectpicker({
  style: 'btn-info',
  size: 4
});

You can set different Bootstrap classes on the button via the data-style attribute. Classes are applied to .btn-group.Apply .span* class to the selects to set the width. Add the disabled attribute to the select to apply the .disabled class. Specify data-size to choose how many items to show in the menu by default. Make the select a dropup menu by adding the .dropup class to the select.

About

A custom select for @twitter bootstrap using button dropdown; originally by Silvio Moreto

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%