Icons#

The icons are loaded as a font when the https://tinka.com/assets/fonts/tinka-fonts.css file is included on the page. This is usually done for you when you use @tinka/tailwindcss or the plain outputs.

Just like FontAwesome, the way to use the icons is also adding .icon class to the element.

But unlike FontAwesome, we use Ligature instead of additional CSS and classes.

The barebone implementation of an icon will be:

<span class="icon">[name-of-the-icon-here]</span>

It does not have to be a span, you can also opt for i to make it more FontAwesome-like!

from @tinka/react#

arrowdown

Properties

As

Label

Children

Class Name

Props

nametypedefaultdescription

Icon Accessibility#

To make the usage of icon accessible to screen reader users, please always consider doing the following:

Add role=img to the tag#

This will let the users know that these are basically images, not text. This will make reading the content easier for people using screen readers.

Option 1: Add aria-hidden="true" if it is visual ornaments.#

If you use icons as just purely visual decorations, add aria-hidden to help screen readers ignore them.

Option 2: Add aria-label if the icon contributes to the content.#

If you use icons to express a certain emotion, or to make a message more complete, adding aria-label to the tag will let your complete message be heard by more people.

A nice label message is not always easy to write or obtain in languages. We don't want people to leave this blank, thus it is okay to write them in English. In this page you can also find example aria-labels below at List of All Icons section.

References:#

Customization#

smile-face

Very easy – just add other Tailwind CSS utility classes.

Since you are already using the fun part of the design system, circle-alert please feel free to be creative and experiment! Let go visual consistency and don't feel like you have to listen to the design team. circle-hourglass

<i
  role="img"
  className="icon animate-bounce text-green-500"
  aria-label="(a bouncing smilely face)"
>
  smileface
</i>
 
<i
  role="img"
  aria-label="(a pinging alert sign)"
  className="icon animate-ping text-red-400"
>
  circlealert
</i>
 
<i
  role="img"
  aria-label="(a spinning hourglass)"
  className="icon animate-spin text-blue-600"
>
  circlehourglass
</i>

circlealert


a cool error message!

<div className="text-center">
  <i
    role="img"
    className="icon text-9xl text-red-400 mt-2"
    aria-label="Attention!"
    >circlealert</i
  >
  <br />
  <em className="font-bold not-italic text-input-invalid-text"
    >a cool error message!</em
  >
</div>

List of all icons#

barcode
aliases
chat
checkerboard
checkmark
circle-hourglass
aliases
close
company
contactless
crystal-ball
aliases
directions
document
edit
filter
gear
history
home
linkedin
list
map
menu
minus
person
plus
quote
return
search
sort
tinka
video
website
apps
arrow-down
aliases
arrow-down-circle
aliases
arrow-down-circle-filled
aliases
arrow-down-filled-square-filled
aliases
arrow-down-heavy
aliases
arrow-down-square
aliases
arrow-left
aliases
arrow-left-circle
aliases
arrow-left-circle-filled
aliases
arrow-left-filled-square-filled
aliases
arrow-left-heavy
aliases
arrow-left-square
aliases
arrow-right
aliases
arrow-right-circle
aliases
arrow-right-circle-filled
aliases
arrow-right-filled-square-filled
aliases
arrow-right-heavy
aliases
arrow-right-square
aliases
arrow-up
aliases
arrow-up-circle
aliases
arrow-up-circle-filled
aliases
arrow-up-filled-square-filled
aliases
arrow-up-heavy
aliases
arrow-up-square
aliases
balance
bank
bank-filled
aliases
bank-note
aliases
barcode-reader
aliases
barcode-reader-filled
aliases
barcode-scan
aliases
calendar
calendar-filled
aliases
call
call-filled
aliases
chat-filled
aliases
checkmark-circle
aliases
checkmark-circle-filled
aliases
checkmark-heavy
aliases
checkmark-square
aliases
checkmark-square-filled
aliases
chevron-down
aliases
chevron-down-circle
aliases
chevron-down-circle-filled
aliases
chevron-down-heavy
aliases
chevron-down-square
aliases
chevron-down-square-filled
aliases
chevron-left
aliases
chevron-left-circle
aliases
chevron-left-circle-filled
aliases
chevron-left-heavy
aliases
chevron-left-square
aliases
chevron-left-square-filled
aliases
chevron-right
aliases
chevron-right-circle
aliases
chevron-right-circle-filled
aliases
chevron-right-heavy
aliases
chevron-right-square
aliases
chevron-right-square-filled
aliases
chevron-small-down
aliases
chevron-small-down-heavy
aliases
chevron-small-left
aliases
chevron-small-left-heavy
aliases
chevron-small-right
aliases
chevron-small-right-heavy
aliases
chevron-small-up
aliases
chevron-small-up-heavy
aliases
chevron-up
aliases
chevron-up-circle
aliases
chevron-up-circle-filled
aliases
chevron-up-heavy
aliases
chevron-up-square
aliases
chevron-up-square-filled
aliases
close-circle
aliases
close-circle-filled
aliases
close-heavy
aliases
close-square
aliases
close-square-filled
aliases
coins
coins-filled
aliases
comment
comment-filled
aliases
company-filled
aliases
contactless-circle
aliases
contactless-circle-filled
aliases
conversation-bubble
aliases
credit-card
aliases
credit-card-filled
aliases
customer-service
aliases
deal
deal-filled
aliases
devices
diamond
document-filled
aliases
edit-calendar
aliases
edit-calendar-filled
aliases
edit-filled
aliases
encrypted
encrypted-filled
aliases
euro-circle
aliases
euro-circle-filled
aliases
exclamation-mark
aliases
exclamation-mark-circle
aliases
exclamation-mark-circle-filled
aliases
exclamation-mark-square
aliases
exclamation-mark-square-filled
aliases
exit
aliases
external-link
aliases
face-id
aliases
file
file-filled
aliases
filter-filled
aliases
fingerprint
gear-filled
aliases
gift
globe
gpp-bad
aliases
gpp-bad-filled
aliases
gpp-maybe
aliases
gpp-maybe-filled
aliases
guarantee
guarantee-filled
aliases
home-filled
aliases
hourglass-empty
aliases
hourglass-full
aliases
hourglass-half-full
aliases
info-circle
aliases
info-circle-filled
aliases
info-square
aliases
info-square-filled
aliases
instalments
instalments-filled
aliases
key
laptop
lightbulb
lightbulb-filled
aliases
linkedin-filled
aliases
loan
loan-filled
aliases
lock-locked
aliases
lock-locked-filled
aliases
lock-unlocked
aliases
lock-unlocked-filled
aliases
logout
mail
aliases
mail-filled
aliases
mail-open
aliases
mail-open-filled
aliases
manage-account
aliases
manage-account-filled
aliases
map-filled
aliases
minus-circle
aliases
minus-heavy
aliases
minus-square
aliases
minus-square-filled
aliases
more-horiz
aliases
more-vert
aliases
no-contactless
aliases
no-contactless-circle
aliases
no-contactless-circle-filled
aliases
no-entry-sign
aliases
no-entry-sign-heavy
aliases
no-photo-camera
aliases
no-photo-camera-filled
aliases
no-video
aliases
no-video-filled
aliases
no-wifi
aliases
notifications
notifications-filled
aliases
notifications-off
aliases
notifications-off-filled
aliases
password-locked
aliases
person-check-filled
aliases
person-circle
aliases
person-circle-filled
aliases
person-circle-filled-negative
aliases
person-circle-filled-negative-off
aliases
person-circle-filled-off
aliases
person-circle-off
aliases
person-filled
aliases
person-filled-off
aliases
person-off
aliases
phone
aliases
phone-disabled
aliases
phone-disabled-filled
aliases
phone-in-talk
aliases
phone-in-talk-filled
aliases
photo-camera
aliases
photo-camera-filled
aliases
pin-drop
aliases
pin-drop-filled
aliases
plus-circle
aliases
plus-circle-filled
aliases
plus-heavy
aliases
plus-square
aliases
plus-square-filled
aliases
qr-code-1
aliases
qr-code-2
aliases
question-mark
aliases
question-mark-circle
aliases
question-mark-circle-filled
aliases
question-mark-square
aliases
question-mark-square-filled
aliases
refresh
reward
reward-filled
aliases
scan-card
aliases
scan-card-filled
aliases
shield-person
aliases
shield-person-filled
aliases
shield-security
aliases
shield-security-filled
aliases
shopping-bag
aliases
shopping-bag-filled
aliases
shopping-cart
aliases
shopping-cart-filled
aliases
smiley-excited
aliases
smiley-excited-filled
aliases
smiley-frustrated
aliases
smiley-frustrated-filled
aliases
smiley-neutral
aliases
smiley-neutral-filled
aliases
smiley-satisfied
aliases
smiley-satisfied-filled
aliases
smiley-unsatisfied
aliases
smiley-unsatisfied-filled
aliases
smiley-very-sarisfied-filled
aliases
smiley-very-satisfied
aliases
smiley-very-unsatisfied
aliases
smiley-very-unsatisfied-filled
aliases
store
store-filled
aliases
tablet
tag
tag-filled
aliases
thumb-up
aliases
thumb-up-filled
aliases
verified
verified-filled
aliases
verified-user
aliases
verified-user-filled
aliases
video-filled
aliases
visibility
aliases
visibility-filled
aliases
visibility-off
aliases
visibility-off-filled
aliases
wallet-1
aliases
wallet-2
aliases
wallet-2-filled
aliases
warning
aliases
warning-filled
aliases
wifi

Additional Information#

Special symbols in icon name will have layout issue on Safari#

A word containing symbols like dash (-) will trigger different layout behaviour on Safari on both macOS and iOS. It is rendered as if the word has no width.

Thus our icon names only contain a~z until further notice.

Using the SVG as a package#

This feature is not ready yet. At the moment the SVGs won't be responsive, nor taking up fill colour from their context. But this will be how you can use them.

npm i "@tinka/icons"

and then

import svgPerson from "@tinka/icons/src/assets/person.svg";

How to create an icon font with ligature support.#

The build script is here: https://github.com/TinkaTech/tinka-ui/blob/main/packages/icons/build.ts

Summary of the build process:

  1. In Figma, make sure all paths are with the correct non-zero fill rule. even-odd is useful, but cannot be automatically converted to non-zero.
  2. I manually download the icons from Figma and put it under src/assets folder.
  3. The script searches through the src/assets folder. Create all lowercase, kebab case names for each SVG file it has found. Folder name will be part of the icon name.
  4. The script uses svgicons2svgfont package to create a SVG font definition. Each glyph will have a unicdoe attribute, which is just the name.
  5. svg2ttf package will then convert the SVG font (.svg) into a TrueType font (.ttf), and then the other popular formats.