107

I work in a project where we don't use JQuery.

Is twitter bootstrap dependant on it ?

Zo72
  • 14,593
  • 17
  • 71
  • 103

5 Answers5

99

Twitter bootstrap itself isn't jQuery dependant.

If you use just the CSS part of it, you won't need jQuery.

If you use the Javascript plugins you need jQuery, since they are jQuery plugins.

v3: http://getbootstrap.com/javascript/

v4: https://getbootstrap.com/docs/4.0/getting-started/javascript/

Bruno Campos
  • 2,188
  • 1
  • 20
  • 34
  • 4
    And some jQuery plugins can be replaced with pure CSS, e.g. for mobile navbar - http://stackoverflow.com/questions/31506684/expand-collapse-mobile-navbar-without-javascript/31506685#31506685 – flexponsive Jul 21 '15 at 15:48
42

Short answer is yes but as Bruno says, the jQuery plugins won't work. To workaround this, I made a small replacement script so the dropdown menus, alert boxes and collapsible nav bar will work without jQuery: http://daniemon.com/blog/bootstrap-without-jquery/

tagawa
  • 4,561
  • 2
  • 27
  • 34
  • No, you still need JavaScript enabled for effects such as showing/hiding the menu and closing alert boxes. – tagawa Nov 25 '14 at 09:02
  • Actually you can use it without those components – Leandro Bardelli Nov 25 '14 at 12:42
  • You're right, you can still use Bootstrap but you'd have to avoid using collapsible menus, alert/dialog boxes, etc. and strip them out of the example pages if you use them as templates. – tagawa Nov 26 '14 at 02:55
40

Yes you can via Native Javascript for Bootstrap. Enjoy

thednp
  • 4,401
  • 4
  • 33
  • 45
  • 2
    I used bootstrap.native in a small project recently that only needed a few bits of Bootstrap's js, and was very happy with the result. – Scribblemacher Mar 20 '17 at 09:40
  • 6
    It's nice to write `shameless self-advertisement` when promoting your github repo on stackoverflow. – zoran404 Jun 15 '18 at 10:42
7

Bootstrap 5 will be without jQuery dependency. Reference: Concerned PR

the_spectator
  • 1,345
  • 11
  • 26
2

You do not need to use jQuery. Boostrap will perform better with native JavaScript than jQuery.

Try one of these:

  1. Bootstrap Native
  2. Bootstrap Native JavaScript
  3. Vue.js
Dan Bray
  • 7,242
  • 3
  • 52
  • 70