Cross-platform unicode icon toolkit
Provides fast access to the most commonly used unicode icons.
var unicons = require("unicons");
console.log(unicons.check); // ✓
console.log(unicons.cross); // ✖
npm i unicons --save
unicons has especially been designed for use in CLIs. If you want to support different OS, just call .cli(iconName)
and you'll get the most suitable character for the given environment:
unicons.cli("circle"); // ● on Unix
// o on Windows
Property | Default | Windows Console Fallback |
---|---|---|
arrowLeft |
← | ← |
arrowUp |
↑ | ↑ |
arrowRight |
→ | → |
arrowDown |
↓ | ↓ |
check |
✓ | √ |
circle |
● | o |
cross |
✖ | × |
copyright |
© | c |
gear |
⚙ | ☼ |
option |
⌥ | < |
super |
⌘ | ∞ |
shift |
⇧ | ↑ |
warning |
⚠ | ! |
The icon table is still very small :(
If you can't find your icon in the icon table, don't hesitate to create a pull request.
If you're feeling lucky, go ahead ;). Copying characters is error prone and might also include unwanted invisible characters. Furthermore, the copied character might be displayed on your computer, but not on someone elses. We think it's better to refer to a name, like arrowLeft
, in this case.
Nope, depending on the character range. Besides that, we might also use two characters on oldschool consoles to represent the icon.
Refer to these resources for integrating more characters: symbl.cc and jrgraphix.net.
In order to find Windows characters, please refer to the Codepage 437 Reference. Most of these will work, however, there is no guarantee :(
Before sending the pull request, please run npm test
on a Unix and a Windows machine (using cmd.exe).
Unlicense