Ngundhuh
Download Bootstrap kanggo entuk CSS lan JavaScript sing dikompilasi, kode sumber, utawa kalebu karo manajer paket favorit kaya npm, RubyGems, lan liya-liyane.
Kompilasi CSS lan JS
Download kode kompilasi sing siap digunakake kanggo Bootstrap v4.6.2 supaya gampang dilebokake menyang proyek sampeyan, kalebu:
- Bundel CSS sing dikompilasi lan dikurangi (deleng perbandingan file CSS )
- Plugin JavaScript sing dikompilasi lan diminimalisir (ndeleng perbandingan file JS )
Iki ora kalebu dokumentasi, file sumber, utawa dependensi JavaScript opsional (jQuery lan Popper).
File sumber
Kompilasi Bootstrap nganggo pipa aset sampeyan kanthi ngundhuh file Sass, JavaScript, lan dokumentasi sumber kita. Opsi iki mbutuhake sawetara perkakas tambahan:
- Sass compiler kanggo kompilasi file sumber Sass menyang file CSS
- Autoprefixer kanggo CSS vendor prefixing
Yen sampeyan mbutuhake set lengkap alat mbangun , padha kalebu kanggo ngembangake Bootstrap lan dokumen, nanging padha ora cocog kanggo tujuan sampeyan dhewe.
Tuladha
Yen sampeyan pengin ndownload lan mriksa conto kita , sampeyan bisa njupuk conto sing wis dibangun:
jsDelivr
Skip download nganggo jsDelivr kanggo ngirim versi cache saka CSS lan JS kompilasi Bootstrap menyang proyek sampeyan.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>
Yen sampeyan nggunakake JavaScript sing dikompilasi lan luwih seneng nglebokake Popper kanthi kapisah, tambahake Popper sadurunge JS kita, luwih becik liwat CDN.
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+" crossorigin="anonymous"></script>
Manajer paket
Narik file sumber Bootstrap menyang meh kabeh proyek karo sawetara manajer paket sing paling populer. Ora preduli manajer paket, Bootstrap mbutuhake kompiler Sass lan Autoprefixer kanggo persiyapan sing cocog karo versi kompilasi resmi kita.
npm
Instal Bootstrap ing aplikasi bertenaga Node.js kanthi paket npm :
npm install bootstrap
require('bootstrap')
bakal mbukak kabeh plugin jQuery Bootstrap menyang obyek jQuery. Modul bootstrap
dhewe ora ngekspor apa-apa. Sampeyan bisa mbukak plugin jQuery Bootstrap kanthi manual kanthi ngemot /js/*.js
file ing direktori tingkat paling dhuwur paket kasebut.
Bootstrap package.json
ngemot sawetara metadata tambahan ing ngisor iki:
sass
- path menyang file sumber Sass utama Bootstrapstyle
- path menyang CSS non-minified Bootstrap sing wis dikompilasi nggunakake setelan gawan (ora kustomisasi)
tenunan
Instal Bootstrap ing aplikasi Node.js sampeyan kanthi paket benang :
yarn add bootstrap
RubyGems
Instal Bootstrap ing aplikasi Ruby sampeyan nggunakake Bundler ( disaranake ) lan RubyGems kanthi nambahake baris ing ngisor iki menyang Gemfile
:
gem 'bootstrap', '~> 4.6.2'
Utawa, yen sampeyan ora nggunakake Bundler, sampeyan bisa nginstal permata kanthi nggunakake printah iki:
gem install bootstrap -v 4.6.2
Waca README permata kanggo rincian liyane.
Komposer
Sampeyan uga bisa nginstal lan ngatur Bootstrap's Sass lan JavaScript nggunakake Composer :
composer require twbs/bootstrap:4.6.2
NuGet
Yen sampeyan ngembangake ing .NET, sampeyan uga bisa nginstal lan ngatur CSS utawa Sass lan JavaScript Bootstrap nggunakake NuGet :
Install-Package bootstrap
Install-Package bootstrap.sass