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#
name type default description
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 barcode aliases barcode_alt barcodealt circle-hourglass circle-hourglass aliases circlehourglass circle_hourglass crystal-ball crystal-ball aliases crystalball crystal_ball arrow-down arrow-down aliases arrowdown arrow_down arrow_light_down arrowlightdown arrow-down-circle arrow-down-circle aliases arrowdowncircle arrow_down_circle arrow-down-circle-filled arrow-down-circle-filled aliases arrowdowncirclefilled arrow_down_circle_filled arrow-down-filled-square-filled arrow-down-filled-square-filled aliases arrowdownfilledsquarefilled arrow_down_filled_square_filled arrow-down-heavy arrow-down-heavy aliases arrowdownheavy arrow_down_heavy arrow-down-square arrow-down-square aliases arrowdownsquare arrow_down_square arrow-left arrow-left aliases arrowleft arrow_left arrow_light_left arrowlightleft arrow-left-circle arrow-left-circle aliases arrowleftcircle arrow_left_circle arrow-left-circle-filled arrow-left-circle-filled aliases arrowleftcirclefilled arrow_left_circle_filled arrow-left-filled-square-filled arrow-left-filled-square-filled aliases arrowleftfilledsquarefilled arrow_left_filled_square_filled arrow-left-heavy arrow-left-heavy aliases arrowleftheavy arrow_left_heavy arrow-left-square arrow-left-square aliases arrowleftsquare arrow_left_square arrow-right arrow-right aliases arrowright arrow_right arrow_light_right arrowlightright arrow-right-circle arrow-right-circle aliases arrowrightcircle arrow_right_circle arrow-right-circle-filled arrow-right-circle-filled aliases arrowrightcirclefilled arrow_right_circle_filled arrow-right-filled-square-filled arrow-right-filled-square-filled aliases arrowrightfilledsquarefilled arrow_right_filled_square_filled arrow-right-heavy arrow-right-heavy aliases arrowrightheavy arrow_right_heavy arrow-right-square arrow-right-square aliases arrowrightsquare arrow_right_square arrow-up arrow-up aliases arrowup arrow_up arrow_light_up arrowlightup arrow-up-circle arrow-up-circle aliases arrowupcircle arrow_up_circle arrow-up-circle-filled arrow-up-circle-filled aliases arrowupcirclefilled arrow_up_circle_filled arrow-up-filled-square-filled arrow-up-filled-square-filled aliases arrowupfilledsquarefilled arrow_up_filled_square_filled arrow-up-heavy arrow-up-heavy aliases arrowupheavy arrow_up_heavy arrow-up-square arrow-up-square aliases arrowupsquare arrow_up_square bank-filled bank-filled aliases bankfilled bank_filled bank-note bank-note aliases banknote bank_note barcode-reader barcode-reader aliases barcodereader barcode_reader barcode-reader-filled barcode-reader-filled aliases barcodereaderfilled barcode_reader_filled barcode-scan barcode-scan aliases barcodescan barcode_scan calendar-filled calendar-filled aliases calendarfilled calendar_filled call-filled call-filled aliases callfilled call_filled chat-filled chat-filled aliases chatfilled chat_filled checkmark-circle checkmark-circle aliases checkmarkcircle checkmark_circle circle_checkmark circlecheckmark checkmark-circle-filled checkmark-circle-filled aliases checkmarkcirclefilled checkmark_circle_filled checkmark-heavy checkmark-heavy aliases checkmarkheavy checkmark_heavy checkmark-square checkmark-square aliases checkmarksquare checkmark_square checkmark-square-filled checkmark-square-filled aliases checkmarksquarefilled checkmark_square_filled chevron-down chevron-down aliases chevrondown chevron_down chevron-down-circle chevron-down-circle aliases chevrondowncircle chevron_down_circle circle_chevron_down circlechevrondown chevron-down-circle-filled chevron-down-circle-filled aliases chevrondowncirclefilled chevron_down_circle_filled chevron-down-heavy chevron-down-heavy aliases chevrondownheavy chevron_down_heavy chevron-down-square chevron-down-square aliases chevrondownsquare chevron_down_square chevron-down-square-filled chevron-down-square-filled aliases chevrondownsquarefilled chevron_down_square_filled chevron-left chevron-left aliases chevronleft chevron_left chevron-left-circle chevron-left-circle aliases chevronleftcircle chevron_left_circle circle_chevron_left circlechevronleft chevron-left-circle-filled chevron-left-circle-filled aliases chevronleftcirclefilled chevron_left_circle_filled chevron-left-heavy chevron-left-heavy aliases chevronleftheavy chevron_left_heavy chevron-left-square chevron-left-square aliases chevronleftsquare chevron_left_square chevron-left-square-filled chevron-left-square-filled aliases chevronleftsquarefilled chevron_left_square_filled chevron-right chevron-right aliases chevronright chevron_right chevron-right-circle chevron-right-circle aliases chevronrightcircle chevron_right_circle circle_chevron_right circlechevronright chevron-right-circle-filled chevron-right-circle-filled aliases chevronrightcirclefilled chevron_right_circle_filled chevron-right-heavy chevron-right-heavy aliases chevronrightheavy chevron_right_heavy chevron-right-square chevron-right-square aliases chevronrightsquare chevron_right_square chevron-right-square-filled chevron-right-square-filled aliases chevronrightsquarefilled chevron_right_square_filled chevron-small-down chevron-small-down aliases chevronsmalldown chevron_small_down chevron-small-down-heavy chevron-small-down-heavy aliases chevronsmalldownheavy chevron_small_down_heavy chevron-small-left chevron-small-left aliases chevronsmallleft chevron_small_left chevron-small-left-heavy chevron-small-left-heavy aliases chevronsmallleftheavy chevron_small_left_heavy chevron-small-right chevron-small-right aliases chevronsmallright chevron_small_right chevron-small-right-heavy chevron-small-right-heavy aliases chevronsmallrightheavy chevron_small_right_heavy chevron-small-up chevron-small-up aliases chevronsmallup chevron_small_up chevron-small-up-heavy chevron-small-up-heavy aliases chevronsmallupheavy chevron_small_up_heavy chevron-up chevron-up aliases chevronup chevron_up chevron-up-circle chevron-up-circle aliases chevronupcircle chevron_up_circle circle_chevron_up circlechevronup chevron-up-circle-filled chevron-up-circle-filled aliases chevronupcirclefilled chevron_up_circle_filled chevron-up-heavy chevron-up-heavy aliases chevronupheavy chevron_up_heavy chevron-up-square chevron-up-square aliases chevronupsquare chevron_up_square chevron-up-square-filled chevron-up-square-filled aliases chevronupsquarefilled chevron_up_square_filled close-circle close-circle aliases closecircle close_circle circle_close circleclose close-circle-filled close-circle-filled aliases closecirclefilled close_circle_filled close-heavy close-heavy aliases closeheavy close_heavy close-square close-square aliases closesquare close_square close-square-filled close-square-filled aliases closesquarefilled close_square_filled coins-filled coins-filled aliases coinsfilled coins_filled comment-filled comment-filled aliases commentfilled comment_filled company-filled company-filled aliases companyfilled company_filled contactless-circle contactless-circle aliases contactlesscircle contactless_circle contactless-circle-filled contactless-circle-filled aliases contactlesscirclefilled contactless_circle_filled conversation-bubble conversation-bubble aliases conversationbubble conversation_bubble credit-card credit-card aliases creditcard credit_card credit-card-filled credit-card-filled aliases creditcardfilled credit_card_filled customer-service customer-service aliases customerservice customer_service deal-filled deal-filled aliases dealfilled deal_filled document-filled document-filled aliases documentfilled document_filled terms edit-calendar edit-calendar aliases editcalendar edit_calendar edit-calendar-filled edit-calendar-filled aliases editcalendarfilled edit_calendar_filled edit-filled edit-filled aliases editfilled edit_filled encrypted-filled encrypted-filled aliases encryptedfilled encrypted_filled euro-circle euro-circle aliases eurocircle euro_circle euro-circle-filled euro-circle-filled aliases eurocirclefilled euro_circle_filled exclamation-mark exclamation-mark aliases exclamationmark exclamation_mark exclamation-mark-circle exclamation-mark-circle aliases exclamationmarkcircle exclamation_mark_circle circle_exclamation_mark circleexclamationmark exclamation-mark-circle-filled exclamation-mark-circle-filled aliases exclamationmarkcirclefilled exclamation_mark_circle_filled exclamation-mark-square exclamation-mark-square aliases exclamationmarksquare exclamation_mark_square exclamation-mark-square-filled exclamation-mark-square-filled aliases exclamationmarksquarefilled exclamation_mark_square_filled exit exit aliases open_door opendoor external-link external-link aliases externallink external_link face-id face-id aliases faceid face_id file-filled file-filled aliases filefilled file_filled filter-filled filter-filled aliases filterfilled filter_filled gear-filled gear-filled aliases gearfilled gear_filled gpp-bad gpp-bad aliases gppbad gpp_bad gpp-bad-filled gpp-bad-filled aliases gppbadfilled gpp_bad_filled gpp-maybe gpp-maybe aliases gppmaybe gpp_maybe gpp-maybe-filled gpp-maybe-filled aliases gppmaybefilled gpp_maybe_filled guarantee-filled guarantee-filled aliases guaranteefilled guarantee_filled home-filled home-filled aliases homefilled home_filled hourglass-empty hourglass-empty aliases hourglassempty hourglass_empty hourglass-full hourglass-full aliases hourglassfull hourglass_full hourglass-half-full hourglass-half-full aliases hourglasshalffull hourglass_half_full hourglass info-circle info-circle aliases infocircle info_circle info info-circle-filled info-circle-filled aliases infocirclefilled info_circle_filled info-square info-square aliases infosquare info_square info-square-filled info-square-filled aliases infosquarefilled info_square_filled instalments-filled instalments-filled aliases instalmentsfilled instalments_filled installments_filled installmentsfilled lightbulb-filled lightbulb-filled aliases lightbulbfilled lightbulb_filled linkedin-filled linkedin-filled aliases linkedinfilled linkedin_filled loan-filled loan-filled aliases loanfilled loan_filled lock-locked lock-locked aliases locklocked lock_locked lock lock-locked-filled lock-locked-filled aliases locklockedfilled lock_locked_filled lock-unlocked lock-unlocked aliases lockunlocked lock_unlocked lock-unlocked-filled lock-unlocked-filled aliases lockunlockedfilled lock_unlocked_filled unlock mail mail aliases envelope_alt envelopealt mail-filled mail-filled aliases mailfilled mail_filled mail-open mail-open aliases mailopen mail_open envelope mail-open-filled mail-open-filled aliases mailopenfilled mail_open_filled manage-account manage-account aliases manageaccount manage_account manage-account-filled manage-account-filled aliases manageaccountfilled manage_account_filled map-filled map-filled aliases mapfilled map_filled minus-circle minus-circle aliases minuscircle minus_circle circle_minus circleminus minus-heavy minus-heavy aliases minusheavy minus_heavy minus-square minus-square aliases minussquare minus_square minus-square-filled minus-square-filled aliases minussquarefilled minus_square_filled more-horiz more-horiz aliases morehoriz more_horiz more-vert more-vert aliases morevert more_vert no-contactless no-contactless aliases nocontactless no_contactless no-contactless-circle no-contactless-circle aliases nocontactlesscircle no_contactless_circle no-contactless-circle-filled no-contactless-circle-filled aliases nocontactlesscirclefilled no_contactless_circle_filled no-entry-sign no-entry-sign aliases noentrysign no_entry_sign no-entry-sign-heavy no-entry-sign-heavy aliases noentrysignheavy no_entry_sign_heavy no-photo-camera no-photo-camera aliases nophotocamera no_photo_camera no-photo-camera-filled no-photo-camera-filled aliases nophotocamerafilled no_photo_camera_filled no-video no-video aliases novideo no_video no-video-filled no-video-filled aliases novideofilled no_video_filled no-wifi no-wifi aliases nowifi no_wifi notifications notifications
notifications-filled notifications-filled aliases notificationsfilled notifications_filled notifications-off notifications-off aliases notificationsoff notifications_off notifications-off-filled notifications-off-filled aliases notificationsofffilled notifications_off_filled password-locked password-locked aliases passwordlocked password_locked person-check-filled person-check-filled aliases personcheckfilled person_check_filled person-circle person-circle aliases personcircle person_circle circle_person circleperson person-circle-filled person-circle-filled aliases personcirclefilled person_circle_filled person-circle-filled-negative person-circle-filled-negative aliases personcirclefillednegative person_circle_filled_negative person-circle-filled-negative-off person-circle-filled-negative-off aliases personcirclefillednegativeoff person_circle_filled_negative_off person-circle-filled-off person-circle-filled-off aliases personcirclefilledoff person_circle_filled_off person-circle-off person-circle-off aliases personcircleoff person_circle_off person-filled person-filled aliases personfilled person_filled person-filled-off person-filled-off aliases personfilledoff person_filled_off person-off person-off aliases personoff person_off phone phone aliases mobile_phone mobilephone phone-disabled phone-disabled aliases phonedisabled phone_disabled phone-disabled-filled phone-disabled-filled aliases phonedisabledfilled phone_disabled_filled phone-in-talk phone-in-talk aliases phoneintalk phone_in_talk phone_call phonecall phone-in-talk-filled phone-in-talk-filled aliases phoneintalkfilled phone_in_talk_filled photo-camera photo-camera aliases photocamera photo_camera photo-camera-filled photo-camera-filled aliases photocamerafilled photo_camera_filled pin-drop pin-drop aliases pindrop pin_drop location_pin locationpin pin-drop-filled pin-drop-filled aliases pindropfilled pin_drop_filled plus-circle plus-circle aliases pluscircle plus_circle circle_plus circleplus plus-circle-filled plus-circle-filled aliases pluscirclefilled plus_circle_filled plus-heavy plus-heavy aliases plusheavy plus_heavy plus-square plus-square aliases plussquare plus_square plus-square-filled plus-square-filled aliases plussquarefilled plus_square_filled qr-code-1 qr-code-1 aliases qrcode1 qr_code_1 qr-code-2 qr-code-2 aliases qrcode2 qr_code_2 question-mark question-mark aliases questionmark question_mark help question-mark-circle question-mark-circle aliases questionmarkcircle question_mark_circle question-mark-circle-filled question-mark-circle-filled aliases questionmarkcirclefilled question_mark_circle_filled question-mark-square question-mark-square aliases questionmarksquare question_mark_square question-mark-square-filled question-mark-square-filled aliases questionmarksquarefilled question_mark_square_filled reward-filled reward-filled aliases rewardfilled reward_filled scan-card scan-card aliases scancard scan_card scan-card-filled scan-card-filled aliases scancardfilled scan_card_filled shield-person shield-person aliases shieldperson shield_person shield-person-filled shield-person-filled aliases shieldpersonfilled shield_person_filled shield-security shield-security aliases shieldsecurity shield_security shield shield-security-filled shield-security-filled aliases shieldsecurityfilled shield_security_filled shopping-bag shopping-bag aliases shoppingbag shopping_bag shopping-bag-filled shopping-bag-filled aliases shoppingbagfilled shopping_bag_filled shopping_bag_alt shoppingbagalt shopping-cart shopping-cart aliases shoppingcart shopping_cart shopping-cart-filled shopping-cart-filled aliases shoppingcartfilled shopping_cart_filled smiley-excited smiley-excited aliases smileyexcited smiley_excited smiley-excited-filled smiley-excited-filled aliases smileyexcitedfilled smiley_excited_filled smiley-frustrated smiley-frustrated aliases smileyfrustrated smiley_frustrated frowning_face_alt frowningfacealt frowning_face frowningface smiley-frustrated-filled smiley-frustrated-filled aliases smileyfrustratedfilled smiley_frustrated_filled frowning_face_filled_alt frowningfacefilledalt smiley-neutral smiley-neutral aliases smileyneutral smiley_neutral neutral_face_alt neutralfacealt neutral_face neutralface smiley-neutral-filled smiley-neutral-filled aliases smileyneutralfilled smiley_neutral_filled neutral_face_filled_alt neutralfacefilledalt smiley-satisfied smiley-satisfied aliases smileysatisfied smiley_satisfied smile_face smileface smile_face_alt smilefacealt smiley-satisfied-filled smiley-satisfied-filled aliases smileysatisfiedfilled smiley_satisfied_filled smile_face_filled_alt smilefacefilledalt smiley-unsatisfied smiley-unsatisfied aliases smileyunsatisfied smiley_unsatisfied smiley-unsatisfied-filled smiley-unsatisfied-filled aliases smileyunsatisfiedfilled smiley_unsatisfied_filled smiley-very-sarisfied-filled smiley-very-sarisfied-filled aliases smileyverysarisfiedfilled smiley_very_sarisfied_filled smiley-very-satisfied smiley-very-satisfied aliases smileyverysatisfied smiley_very_satisfied smiley-very-unsatisfied smiley-very-unsatisfied aliases smileyveryunsatisfied smiley_very_unsatisfied smiley-very-unsatisfied-filled smiley-very-unsatisfied-filled aliases smileyveryunsatisfiedfilled smiley_very_unsatisfied_filled store-filled store-filled aliases storefilled store_filled tag-filled tag-filled aliases tagfilled tag_filled thumb-up thumb-up aliases thumbup thumb_up thumb-up-filled thumb-up-filled aliases thumbupfilled thumb_up_filled verified-filled verified-filled aliases verifiedfilled verified_filled verified-user verified-user aliases verifieduser verified_user verified-user-filled verified-user-filled aliases verifieduserfilled verified_user_filled video-filled video-filled aliases videofilled video_filled visibility visibility aliases open_eye openeye visibility-filled visibility-filled aliases visibilityfilled visibility_filled visibility-off visibility-off aliases visibilityoff visibility_off eye_closed eyeclosed visibility-off-filled visibility-off-filled aliases visibilityofffilled visibility_off_filled wallet-1 wallet-1 aliases wallet1 wallet_1 wallet-2 wallet-2 aliases wallet2 wallet_2 wallet-2-filled wallet-2-filled aliases wallet2filled wallet_2_filled warning warning aliases circle_alert circlealert warning-filled warning-filled aliases warningfilled warning_filled
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.
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:
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
.
I manually download the icons from Figma and put it under src/assets
folder.
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.
The script uses svgicons2svgfont
package to create a SVG font definition. Each glyph will have a unicdoe attribute, which is just the name.
svg2ttf
package will then convert the SVG font (.svg
) into a TrueType font (.ttf
), and then the other popular formats.