What is ionicons?
The ionicons npm package provides a collection of premium icons for use in web, iOS, Android, and desktop apps. These icons are designed to be used with Ionic Framework but can also be used in any web project. The package includes a variety of icons for different purposes such as user interface design, branding, and visual indicators.
What are ionicons's main functionalities?
Using Ionicons in a Web Project
This code sample demonstrates how to include an Ionicon in your HTML. The 'name' attribute specifies which icon to display.
<ion-icon name="heart"></ion-icon>
Styling Ionicons with CSS
This CSS code sets the size and color of all Ionicons in a web page. You can customize the icons further using standard CSS properties.
ion-icon {
font-size: 50px;
color: blue;
}
Using Ionicons in JavaScript Frameworks
This code sample shows how to import an Ionicon into a JavaScript framework like Vue or React and use it within the framework's template syntax.
import { heart } from 'ionicons/icons';
<ion-icon :icon="heart"></ion-icon>
Other packages similar to ionicons
font-awesome
Font Awesome is a widely used icon set and toolkit that offers a similar range of icons for web development. It has both free and pro versions, and it's comparable to Ionicons in terms of the variety of icons available. However, Font Awesome icons are primarily distributed as a font, whereas Ionicons are available as web components.
material-icons
Material Icons are Google's icon set designed to work with Material Design components. They offer a different aesthetic compared to Ionicons, which is more in line with Google's Material Design philosophy. Material Icons are also available as a font and can be easily integrated into web projects.
feather
Feather is a collection of simply beautiful open source icons. Each icon is designed on a 24x24 grid with an emphasis on simplicity, consistency, and readability. Feather provides a more minimalistic and simple design compared to Ionicons, which may be more detailed and varied in design.
Ionicons
The premium icon font for Ionic. Designed by @benjsperry.
Note: All brand icons are trademarks of their respective owners. The use of these trademarks does not indicate endorsement of the trademark holder by Drifty, nor vice versa.
Visit ionicons.com and check out the search feature, which has keywords identifying common icon names and styles. For example, if you search for “arrow” we call up every icon that could possibly be used as an arrow. We’ve also included each icon’s class name for easy copy/pasting when you’re developing!
We intend for this icon pack to be used with Ionic, but it’s by no means limited to it. Use them wherever you see fit, personal or commercial. They are free to use and licensed under MIT.
Getting Started
- Download and extract the font pack
- Copy the
ionicons.css
to your project - Copy the
fonts
folder to your project - Ensure the font urls within
ionicons.css
properly reference the fonts
path within your project. - Include a reference to the
ionicons.css
file from every webpage you need to use it.
HTML Example
You can use ionicons.com to easily find the icon you want to use. Once you've copied the desired icon's CSS classname, simply add the icon
and icon's classname, such as ion-home
to an HTML element.
<i class="icon ion-home"></i>
Build Instructions
This repo already comes with all the files built and ready to go, but can also build the fonts from the source. Requires Python, FontForge, WOFF2, SVGO and Sass:
-
Install FontForge, which is the program that creates the font files from the SVG files:
$ brew install fontforge ttfautohint
-
Install Google's WOFF2 font compressor
https://github.com/google/woff2
-
Install Sass
$ gem install sass
-
Install SVGO
$ npm install -g svgo
-
Add or subtract files from the src/
folder you'd like to be apart of the build.
-
Modify any settings in the builder/manifest.json
file. You can change the name of the font-family and CSS classname prefix.
-
Run the build command:
python ./builder/generate.py
License
Ionicons is licensed under the MIT license.