Getting Started

Switching to boxicons is easy and can be done in 2 steps. There are more features than just the icons set. Boxicons also follows the official Google Material Design guidelines

Quick Start

Looking to quickly add Boxicons to your project? Use the paths to CDN or Download the files here.

Install via NPM

Install the boxicons package by copy pasting the following in your terminal:

 $ npm install boxicons --save

Import the npm module in your javascript

 import 'boxicons'

Using the Web Component

Boxicons includes a Custom Element that makes using icons easy and efficient. To use it, add the boxicons.js file to the page:

  <script src="https://unpkg.com/boxicons@latest/dist/boxicons.js"></script>

To use an icon, add the box-icon element to the location where the icon should be displayed:

 <box-icon name="rocket"></box-icon>

To use solid icons or logos add attribute type as solid or logo

 <box-icon  type="solid" name="rocket"></box-icon>
<box-icon type="logo" name="facebook-square"></box-icon>

The box-icon custom element supports the following attributes:

 <box-icon 
type = "regular|solid|logo"
name="adjust|alarms|etc...."
color="blue|red|etc..."
size="xs|sm|md|lg|cssSize"
rotate="90|180|270"
flip="horizontal|vertical"
border="square|circle"
animation="spin|tada|etc..."
animation="spin|tada|etc..."
pull = "left|right"
></box-icon>

Usage as a Font

Import the CSS

Copy-paste the stylesheet link into your head to load our CSS

 <link href='https://cdn.jsdelivr.net/npm/boxicons@2.0.2/css/boxicons.min.css' rel='stylesheet'>
<!-- or -->
<link href='https://unpkg.com/boxicons@2.0.2/css/boxicons.min.css' rel='stylesheet'>

This will load boxicons font into your webpage

HTML

To use an icon on your page, add a prefixbx- for regular icons, bxs- for solid icons & bxl- for logos followed by the icon name and seperate class with thebx:

 <i class='bx bx-user'></i>
<i class='bx bxs-user'></i>
<i class='bx bxl-facebook-square'></i>
You can see the names of all the icons here

Starter Templates

Create an HTML document and copy-paste the starter template

 <!doctype html> 
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1, shrink-to-fit=no'>
<!-- Boxicons CSS -->
<link href='https://cdn.jsdelivr.net/npm/boxicons@2.0.2/css/boxicons.min.css' rel='stylesheet'>
<title>Hello, Boxicons!</title>
</head>
<body>
<h1>Hello, Boxicons!</h1>
<i class='bx bx-hot'></i>
<i class='bx bxs-hot'></i>
<i class='bx bxl-facebook-square'></i>
</body>
</html>

A template for usage with the web component instead of icon font

 <!doctype html> 
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1, shrink-to-fit=no'>
<!-- Boxicons JS -->
<link href='https://cdn.jsdelivr.net/npm/boxicons@2.0.2/dist/boxicons.js' rel='stylesheet'>
<title>Hello, Boxicons!</title>
</head>
<body>
<h1>Hello, Boxicons!</h1>
<box-icon name='hot'></box-icon>
<box-icon type='solid' name='hot'></box-icon>
<box-icon type='logo' name='facebook-square'></box-icon>
</body>
</html>

Styling

Sizing

You can change size of the icon withfont-size CSS. It will inherit the font-sizefrom the parent by default. There are fixed sizes you can add to the icon by adding classesbx-xs, bx-sm, bx-md and bx-lg

 <i class='bx bxs-smiley-happy bx-xs'></i>
<i class='bx bxs-smiley-happy bx-sm'></i>
<i class='bx bxs-smiley-happy bx-md'></i>
<i class='bx bxs-smiley-happy bx-lg'></i>

<!-- Boxicons web component -->

<box-icon name='smiley-happy' size='lg'></box-icon>

Rotation & Flipping

Rotate the icons using classes bx-rotate-90, bx-rotate-180 and bx-rotate-270 or Flip the icons using bx-flip-horizontal and bx-flip-vertical

 <i class='bx bxs-like bx-rotate-90'></i>
<i class='bx bxs-like bx-rotate-180'></i>
<i class='bx bxs-like bx-rotate-270'></i>
<i class='bx bxs-like bx-flip-horizontal'></i>
<i class='bx bxs-like bx-flip-vertical '></i>

<!-- Boxicons web component -->

<box-icon name='like' rotate='90'></box-icon>
<box-icon name='like' flip='horizontal'></box-icon>

List Icons

Use icons as bullets for the list by adding class bx-ul to the unordered list element and include the icons inside theli

  • List item 1
  • List item 2
  • List item 3
 <ul class='bx-ul'>
<li><i class='bx bx-right-arrow'></i>List Item 1</li>
<li><i class='bx bx-x'></i>List Item 2</li>
<li><i class='bx bx-plus'></i>List Item 3</li>
</ul>

Fixed Width

You can use fixed width class bx-fw \to get a fixed width icon next to the textli

Facebook
Slack
Instagram
 <i class="bx-fw bx bxl-facebook-square"></i>Facebook

Pulled Icons

Use class bx-pull-left or bx-pull-right on icons for easy pull quotesli

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut faucibus erat eu nibh laoreet, sed ullamcorper diam ornare. Quisque viverra ante nec luctus imperdiet. Quisque ut imperdiet nisi. Quisque ultrices laoreet odio, non vestibulum lacus molestie sollicitudin. Phasellus nec dolor eget nunc commodo sodales vel vel eros.
 <i className="bx-pull-left bx bxs-quote-alt-left bx-lg"/>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut faucibus erat eu nibh laoreet, sed ullamcorper diam ornare. Quisque viverra ante nec luctus imperdiet. Quisque ut imperdiet nisi. Quisque ultrices laoreet odio, non vestibulum lacus molestie sollicitudin. Phasellus nec dolor eget nunc commodo sodales vel vel eros.
<!-- Boxicons web component -->

<box-icon name='like' pull='left' size='lg'></box-icon>
Quisque ultrices laoreet odio, non vestibulum lacus molestie sollicitudin. Phasellus nec dolor eget nunc commodo sodales vel vel eros.

Border

Add border to your icons with classes bx-border, bx-border-circle

 <i class='bx bxs-heart bx-border'></i>
<i class='bx bxs-heart bx-border-circle'></i>

<!-- Boxicons web component -->

<box-icon name='heart' border='circle'></box-icon>

Animation

Animate your icons with pre built CSS animations using classes bx-spin,bx-tada,bx-flashing,bx-burst,bx-fade-left and bx-fade-right

You can change the speed of the animation with the animation-duration property & to change the number of times the animation takes place with the property animation-iteration-count in CSS

 <i class='bx bxs-like bx-spin'></i>
<i class='bx bxs-like bx-tada'></i>
<i class='bx bxs-like bx-flashing'></i>
<i class='bx bxs-like bx-burst'></i>
<i class='bx bxs-like bx-fade-left'></i>
<i class='bx bxs-like bx-fade-right'></i>
<i class='bx bxs-like bx-fade-up'></i>
<i class='bx bxs-like bx-fade-down'></i>

<!-- Boxicons web component -->

<box-icon name='bell' animation='tada'></box-icon>

Animation on Hover

Animate your icons on hover with pre built CSS animations using classes bx-spin-hover,bx-tada-hover,bx-flashing-hover,bx-burst-hover,bx-fade-left-hover and bx-fade-right-hover

You can change the speed of the animation with the animation-duration property & to change the number of times the animation takes place with the property animation-iteration-count in CSS

 <i class='bx bxs-like bx-spin-hover'></i>
<i class='bx bxs-like bx-tada-hover'></i>
<i class='bx bxs-like bx-flashing-hover'></i>
<i class='bx bxs-like bx-burst-hover'></i>
<i class='bx bxs-like bx-fade-left-hover'></i>
<i class='bx bxs-like bx-fade-right-hover'></i>
<i class='bx bxs-like bx-fade-up-hover'></i>
<i class='bx bxs-like bx-fade-down-hover'></i>

<!-- Boxicons web component -->

<box-icon name='bell' animation='tada-hover'></box-icon>

Contribution

Want to report a bug ? Have some suggestions or ideas ? Have an icon or a feature request? Create a new issue on Github with the appropriate label here

License

Boxicons is an open source project , you can use them in your commercial projects too.
The icons (.svg) files are free to download and are licensed under CC 4.0 . By downloading it is assumed that you agree with the terms mentioned in CC 4.0.
The fonts files are licensed under SIL OFL 1.1
Attribution is not required but is appreciated
Other files which are not fonts or icons are licensed under the MIT License