Unicode symbols with fallbacks for older terminals
Installations
npm install figures
Developer Guide
Typescript
Yes
Module System
ESM
Min. Node Version
>=18
Node Version
21.6.2
NPM Version
9.2.0
Score
99.7
Supply Chain
99.5
Quality
76.9
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (93.74%)
TypeScript (6.26%)
Developer
sindresorhus
Download Statistics
Total Downloads
8,478,874,589
Last Day
6,656,276
Last Week
30,054,037
Last Month
136,674,430
Last Year
1,788,232,359
GitHub Statistics
599 Stars
129 Commits
23 Forks
12 Watching
1 Branches
11 Contributors
Bundle Size
6.51 kB
Minified
2.18 kB
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
6.1.0
Package Id
figures@6.1.0
Unpacked Size
35.98 kB
Size
7.07 kB
File Count
5
NPM Version
9.2.0
Node Version
21.6.2
Publised On
04 Mar 2024
Total Downloads
Cumulative downloads
Total Downloads
8,478,874,589
Last day
-4.5%
6,656,276
Compared to previous day
Last week
-15.6%
30,054,037
Compared to previous week
Last month
3.8%
136,674,430
Compared to previous month
Last year
10.4%
1,788,232,359
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
figures
Unicode symbols with fallbacks for older terminals
Terminals such as Windows Console Host (and CMD) only support a limited character set.
Install
1npm install figures
Usage
1import figures, {mainSymbols, fallbackSymbols, replaceSymbols} from 'figures'; 2 3console.log(figures.tick); 4// On terminals with Unicode symbols: ✔ 5// On other terminals: √ 6 7console.log(mainSymbols.tick); 8// On all terminals: ✔ 9 10console.log(fallbackSymbols.tick); 11// On all terminals: √ 12 13console.log(replaceSymbols('✔ check')); 14// On terminals with Unicode symbols: ✔ check 15// On other terminals: √ check
API
figures (default export)
Type: object
Symbols to use on any terminal.
mainSymbols
Symbols to use when the terminal supports Unicode symbols.
fallbackSymbols
Symbols to use when the terminal does not support Unicode symbols.
replaceSymbols(string, options?)
Returns the input with replaced fallback symbols if the terminal has poor Unicode support.
All the below figures are attached to the default export as shown in the example above.
string
Type: string
String where the Unicode symbols will be replaced with fallback symbols depending on the terminal.
options
Type: object
useFallback
Type: boolean
Default: true
if the terminal has poor Unicode support
Whether to replace symbols with fallbacks.
This can be set to true
to always use fallback symbols, whether the terminal has poor Unicode support or not.
1import {replaceSymbols} from 'figures'; 2 3console.log(replaceSymbols('✔ check', {useFallback: true})); 4// On terminals with Unicode symbols: √ check 5// On other terminals: √ check
Figures
Fallback
characters are only shown when they differ from the Main
ones.
Name | Main | Fallback |
---|---|---|
tick | ✔ | √ |
info | ℹ | i |
warning | ⚠ | ‼ |
cross | ✘ | × |
square | █ | |
squareSmall | ◻ | □ |
squareSmallFilled | ◼ | ■ |
squareDarkShade | ▓ | |
squareMediumShade | ▒ | |
squareLightShade | ░ | |
squareTop | ▀ | |
squareBottom | ▄ | |
squareLeft | ▌ | |
squareRight | ▐ | |
squareCenter | ■ | |
circle | ◯ | ( ) |
circleFilled | ◉ | (*) |
circleDotted | ◌ | ( ) |
circleDouble | ◎ | ( ) |
circleCircle | ⓞ | (○) |
circleCross | ⓧ | (×) |
circlePipe | Ⓘ | (│) |
circleQuestionMark | ?⃝ | (?) |
radioOn | ◉ | (*) |
radioOff | ◯ | ( ) |
checkboxOn | ☒ | [×] |
checkboxOff | ☐ | [ ] |
checkboxCircleOn | ⓧ | (×) |
checkboxCircleOff | Ⓘ | ( ) |
questionMarkPrefix | ?⃝ | ? |
bullet | ● | |
dot | ․ | |
ellipsis | … | |
pointer | ❯ | > |
pointerSmall | › | › |
triangleUp | ▲ | |
triangleUpSmall | ▴ | |
triangleUpOutline | △ | ∆ |
triangleDown | ▼ | |
triangleDownSmall | ▾ | |
triangleLeft | ◀ | ◄ |
triangleLeftSmall | ◂ | |
triangleRight | ▶ | ► |
triangleRightSmall | ▸ | |
lozenge | ◆ | ♦ |
lozengeOutline | ◇ | ◊ |
home | ⌂ | |
hamburger | ☰ | ≡ |
smiley | ㋡ | ☺ |
mustache | ෴ | ┌─┐ |
heart | ♥ | |
star | ★ | ✶ |
play | ▶ | ► |
musicNote | ♪ | |
musicNoteBeamed | ♫ | |
nodejs | ⬢ | ♦ |
arrowUp | ↑ | |
arrowDown | ↓ | |
arrowLeft | ← | |
arrowRight | → | |
arrowLeftRight | ↔ | |
arrowUpDown | ↕ | |
almostEqual | ≈ | |
notEqual | ≠ | |
lessOrEqual | ≤ | |
greaterOrEqual | ≥ | |
identical | ≡ | |
infinity | ∞ | |
subscriptZero | ₀ | |
subscriptOne | ₁ | |
subscriptTwo | ₂ | |
subscriptThree | ₃ | |
subscriptFour | ₄ | |
subscriptFive | ₅ | |
subscriptSix | ₆ | |
subscriptSeven | ₇ | |
subscriptEight | ₈ | |
subscriptNine | ₉ | |
oneHalf | ½ | |
oneThird | ⅓ | |
oneQuarter | ¼ | |
oneFifth | ⅕ | |
oneSixth | ⅙ | |
oneSeventh | ⅐ | 1/7 |
oneEighth | ⅛ | |
oneNinth | ⅑ | 1/9 |
oneTenth | ⅒ | 1/10 |
twoThirds | ⅔ | |
twoFifths | ⅖ | |
threeQuarters | ¾ | |
threeFifths | ⅗ | |
threeEighths | ⅜ | |
fourFifths | ⅘ | |
fiveSixths | ⅚ | |
fiveEighths | ⅝ | |
sevenEighths | ⅞ | |
line | ─ | |
lineBold | ━ | |
lineDouble | ═ | |
lineDashed0 | ┄ | |
lineDashed1 | ┅ | |
lineDashed2 | ┈ | |
lineDashed3 | ┉ | |
lineDashed4 | ╌ | |
lineDashed5 | ╍ | |
lineDashed6 | ╴ | |
lineDashed7 | ╶ | |
lineDashed8 | ╸ | |
lineDashed9 | ╺ | |
lineDashed10 | ╼ | |
lineDashed11 | ╾ | |
lineDashed12 | − | |
lineDashed13 | – | |
lineDashed14 | ‐ | |
lineDashed15 | ⁃ | |
lineVertical | │ | |
lineVerticalBold | ┃ | |
lineVerticalDouble | ║ | |
lineVerticalDashed0 | ┆ | |
lineVerticalDashed1 | ┇ | |
lineVerticalDashed2 | ┊ | |
lineVerticalDashed3 | ┋ | |
lineVerticalDashed4 | ╎ | |
lineVerticalDashed5 | ╏ | |
lineVerticalDashed6 | ╵ | |
lineVerticalDashed7 | ╷ | |
lineVerticalDashed8 | ╹ | |
lineVerticalDashed9 | ╻ | |
lineVerticalDashed10 | ╽ | |
lineVerticalDashed11 | ╿ | |
lineDownLeft | ┐ | |
lineDownLeftArc | ╮ | |
lineDownBoldLeftBold | ┓ | |
lineDownBoldLeft | ┒ | |
lineDownLeftBold | ┑ | |
lineDownDoubleLeftDouble | ╗ | |
lineDownDoubleLeft | ╖ | |
lineDownLeftDouble | ╕ | |
lineDownRight | ┌ | |
lineDownRightArc | ╭ | |
lineDownBoldRightBold | ┏ | |
lineDownBoldRight | ┎ | |
lineDownRightBold | ┍ | |
lineDownDoubleRightDouble | ╔ | |
lineDownDoubleRight | ╓ | |
lineDownRightDouble | ╒ | |
lineUpLeft | ┘ | |
lineUpLeftArc | ╯ | |
lineUpBoldLeftBold | ┛ | |
lineUpBoldLeft | ┚ | |
lineUpLeftBold | ┙ | |
lineUpDoubleLeftDouble | ╝ | |
lineUpDoubleLeft | ╜ | |
lineUpLeftDouble | ╛ | |
lineUpRight | └ | |
lineUpRightArc | ╰ | |
lineUpBoldRightBold | ┗ | |
lineUpBoldRight | ┖ | |
lineUpRightBold | ┕ | |
lineUpDoubleRightDouble | ╚ | |
lineUpDoubleRight | ╙ | |
lineUpRightDouble | ╘ | |
lineUpDownLeft | ┤ | |
lineUpBoldDownBoldLeftBold | ┫ | |
lineUpBoldDownBoldLeft | ┨ | |
lineUpDownLeftBold | ┥ | |
lineUpBoldDownLeftBold | ┩ | |
lineUpDownBoldLeftBold | ┪ | |
lineUpDownBoldLeft | ┧ | |
lineUpBoldDownLeft | ┦ | |
lineUpDoubleDownDoubleLeftDouble | ╣ | |
lineUpDoubleDownDoubleLeft | ╢ | |
lineUpDownLeftDouble | ╡ | |
lineUpDownRight | ├ | |
lineUpBoldDownBoldRightBold | ┣ | |
lineUpBoldDownBoldRight | ┠ | |
lineUpDownRightBold | ┝ | |
lineUpBoldDownRightBold | ┡ | |
lineUpDownBoldRightBold | ┢ | |
lineUpDownBoldRight | ┟ | |
lineUpBoldDownRight | ┞ | |
lineUpDoubleDownDoubleRightDouble | ╠ | |
lineUpDoubleDownDoubleRight | ╟ | |
lineUpDownRightDouble | ╞ | |
lineDownLeftRight | ┬ | |
lineDownBoldLeftBoldRightBold | ┳ | |
lineDownLeftBoldRightBold | ┯ | |
lineDownBoldLeftRight | ┰ | |
lineDownBoldLeftBoldRight | ┱ | |
lineDownBoldLeftRightBold | ┲ | |
lineDownLeftRightBold | ┮ | |
lineDownLeftBoldRight | ┭ | |
lineDownDoubleLeftDoubleRightDouble | ╦ | |
lineDownDoubleLeftRight | ╥ | |
lineDownLeftDoubleRightDouble | ╤ | |
lineUpLeftRight | ┴ | |
lineUpBoldLeftBoldRightBold | ┻ | |
lineUpLeftBoldRightBold | ┷ | |
lineUpBoldLeftRight | ┸ | |
lineUpBoldLeftBoldRight | ┹ | |
lineUpBoldLeftRightBold | ┺ | |
lineUpLeftRightBold | ┶ | |
lineUpLeftBoldRight | ┵ | |
lineUpDoubleLeftDoubleRightDouble | ╩ | |
lineUpDoubleLeftRight | ╨ | |
lineUpLeftDoubleRightDouble | ╧ | |
lineUpDownLeftRight | ┼ | |
lineUpBoldDownBoldLeftBoldRightBold | ╋ | |
lineUpDownBoldLeftBoldRightBold | ╈ | |
lineUpBoldDownLeftBoldRightBold | ╇ | |
lineUpBoldDownBoldLeftRightBold | ╊ | |
lineUpBoldDownBoldLeftBoldRight | ╉ | |
lineUpBoldDownLeftRight | ╀ | |
lineUpDownBoldLeftRight | ╁ | |
lineUpDownLeftBoldRight | ┽ | |
lineUpDownLeftRightBold | ┾ | |
lineUpBoldDownBoldLeftRight | ╂ | |
lineUpDownLeftBoldRightBold | ┿ | |
lineUpBoldDownLeftBoldRight | ╃ | |
lineUpBoldDownLeftRightBold | ╄ | |
lineUpDownBoldLeftBoldRight | ╅ | |
lineUpDownBoldLeftRightBold | ╆ | |
lineUpDoubleDownDoubleLeftDoubleRightDouble | ╬ | |
lineUpDoubleDownDoubleLeftRight | ╫ | |
lineUpDownLeftDoubleRightDouble | ╪ | |
lineCross | ╳ | |
lineBackslash | ╲ | |
lineSlash | ╱ |
Other characters
If you cannot find the character you're looking for in the table above, please look at this full list of cross-platform terminal characters.
Unsupported terminals
The following terminals are not officially supported:
- xterm
- Linux Terminal (kernel)
- cmder
They can display most but not all of the symbols listed above.
Related
- log-symbols - Colored symbols for various log levels
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
security policy file detected
Details
- Info: security policy file detected: .github/security.md:1
- Info: Found linked content: .github/security.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: .github/security.md:1
- Info: Found text in security policy: .github/security.md:1
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: license:0
- Info: FSF or OSI recognized license: MIT License: license:0
Reason
0 existing vulnerabilities detected
Reason
Found 19/30 approved changesets -- score normalized to 6
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/figures/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/figures/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:25
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 19 are checked with a SAST tool
Score
4.6
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to figures
@inquirer/figures
Vendored version of figures, for CJS compatibility
log-symbols
Colored symbols for various log levels. Example: `✔︎ Success`
markdown-it-implicit-figures
Render images occurring by itself in a paragraph as `<figure><img ...></figure>`, similar to pandoc's implicit_figures
markdown-it-image-figures
Render images occurring by itself in a paragraph as a figure with support for figcaptions.