npm.devtool.tech
๐Ÿ‘ You can access figures package with using figures variable in browser devtools!
Unicode symbols with fallbacks for older terminals

basic

package
Npm Version
Node Version

popularity

Star
Npm Weekly Downloads
Jsdeliver Month Downloads
Dependents Pkg
Dependents Repo

size

Code Size
Publish Size
Install Size
Minified Size
Gzip Size

quality

Open Issues
Tree Shaking Support
Type Support
Last Commit

health

Package health
Dependency Count
Outdated Dep
Vulnerablities

figures

Unicode symbols with fallbacks for older terminals

and more...

Terminals such as Windows Console Host (and CMD) only support a limited character set.

Install

npm install figures

Usage

import figures, {mainSymbols, fallbackSymbols, replaceSymbols} from 'figures';

console.log(figures.tick);
// On terminals with Unicode symbols:  โœ”
// On other terminals:                 โˆš

console.log(mainSymbols.tick);
// On all terminals:  โœ”

console.log(fallbackSymbols.tick);
// On all terminals:  โˆš

console.log(replaceSymbols('โœ” check'));
// On terminals with Unicode symbols:  โœ” check
// 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.

import {replaceSymbols} from 'figures';

console.log(replaceSymbols('โœ” check', {useFallback: true}));
// On terminals with Unicode symbols:  โˆš check
// On other terminals:                 โˆš check

Figures

Fallback characters are only shown when they differ from the Main ones.

NameMainFallback
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