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 v5.0.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 kaya 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:
CDN liwat jsDelivr
Skip download nganggo jsDelivr kanggo ngirim versi cache saka CSS lan JS kompilasi Bootstrap menyang proyek sampeyan.
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" 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/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" 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
const bootstrap = require('bootstrap')
utawa import bootstrap from 'bootstrap'
bakal mbukak kabeh plugin Bootstrap menyang bootstrap
obyek. Modul bootstrap
kasebut dhewe ngekspor kabeh plugin kita. Sampeyan bisa mbukak plugin Bootstrap kanthi manual kanthi ngemot /js/dist/*.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', '~> 5.0.2'
Utawa, yen sampeyan ora nggunakake Bundler, sampeyan bisa nginstal permata kanthi nggunakake printah iki:
gem install bootstrap -v 5.0.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:5.0.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