Official open source SVG icon library for Bootstrap.
Перейти к файлу
XhmikosR 2357f3f11b Update devDependencies and regenerate package-lock.json 2024-09-02 18:18:30 +03:00
.github build(deps): bump peaceiris/actions-gh-pages in the github-actions group (#2005) 2024-05-01 09:26:10 +03:00
build Release v1.11.3 (#1897) 2024-01-03 17:44:45 +02:00
docs Fix edge case in `color-modes.js` (#1854) 2024-01-09 08:27:42 +02:00
font Release v1.11.3 (#1897) 2024-01-03 17:44:45 +02:00
icons Release v1.11.3 (#1897) 2024-01-03 17:44:45 +02:00
.browserslistrc Update .browserslistrc from upstream (#1231) 2022-02-22 09:34:01 +02:00
.editorconfig Add .editorconfig file. 2019-10-05 16:27:57 +03:00
.fantasticonrc.js Clean up .fantasticonrc.js 2023-03-25 10:36:40 +02:00
.gitattributes Enforce LF. 2019-08-10 14:23:11 +03:00
.gitignore npm scripts: move cache dir to root 2023-04-12 18:22:56 +03:00
.stylelintrc.json Update .stylelintrc.json (#1631) 2023-03-23 09:48:55 +02:00
LICENSE Bump year to 2024 2024-01-02 08:18:16 +02:00
README.md Added link to MIT License (#1855) 2023-11-21 17:51:26 +02:00
bootstrap-icons.svg Release v1.11.3 (#1897) 2024-01-03 17:44:45 +02:00
composer.json Composer support (#1038) 2021-10-12 10:18:59 -07:00
eslint.config.mjs Update ESLint to v9.4.0 and regenerate package-lock.json (#2012) 2024-06-02 08:38:53 +03:00
hugo.yml Release v1.11.3 (#1897) 2024-01-03 17:44:45 +02:00
package-lock.json Update devDependencies and regenerate package-lock.json 2024-09-02 18:18:30 +03:00
package.json Update devDependencies and regenerate package-lock.json 2024-09-02 18:18:30 +03:00
svg-sprite.json Update svgo config (#1888) 2023-12-11 08:10:25 +02:00
svgo.config.mjs Update svgo config (#1888) 2023-12-11 08:10:25 +02:00

README.md

Bootstrap logo

Bootstrap Icons

Official open source SVG icon library for Bootstrap with over 2,000 icons.
Explore Bootstrap Icons »

Bootstrap · Themes · Blog

Bootstrap Icons preview

Install

Bootstrap Icons are packaged up and published to npm. We only include the processed SVGs in this package—it's up to you and your team to implement. Read our docs for usage instructions.

npm i bootstrap-icons

For those using Packagist, you can also install Bootstrap Icons via Composer:

composer require twbs/bootstrap-icons

Also available in Figma.

Usage

Depending on your setup, you can include Bootstrap Icons in a handful of ways.

  • Copy-paste SVGs as embedded HTML
  • Reference via <img> element
  • Use the SVG sprite
  • Include via CSS

See the docs for more information.

Development

Build Status npm version

Clone the repo, install dependencies, and start the Hugo server locally.

git clone https://github.com/twbs/icons/
cd icons
npm i
npm start

Then open http://localhost:4000 in your browser.

npm scripts

Here are some key scripts you'll use during development. Be sure to look to our package.json or npm run output for a complete list of scripts.

Script Description
start Alias for running docs-serve
docs-serve Starts a local Hugo server
pages Generates permalink pages for each icon with template Markdown
icons Processes and optimizes SVGs in icons directory, generates fonts and sprite

Adding SVGs

Icons are typically only added by @mdo, but exceptions can be made. New glyphs are designed in Figma first on a 16x16px grid, then exported as flattened SVGs with fill (no stroke). Once a new SVG icon has been added to the icons directory, we use an npm script to:

  1. Optimize our SVGs with SVGO.
  2. Modify the SVGs source code, removing all attributes before setting new attributes and values in our preferred order.

Use npm run icons to run the script, run npm run pages to build permalink pages, complete those pages, and, finally, commit the results in a new branch for updating.

Warning: Please exclude any auto-generated files, like font/** and bootstrap-icons.svg from your branch because they cause conflicts, and we generally update the dist files before a release.

Publishing

Documentation is published automatically when a new Git tag is published. See our GitHub Actions and package.json for more information.

License

MIT

Author

@mdo