Gathering detailed insights and metrics for @visa/nova-icons-react
Gathering detailed insights and metrics for @visa/nova-icons-react
Gathering detailed insights and metrics for @visa/nova-icons-react
Gathering detailed insights and metrics for @visa/nova-icons-react
npm install @visa/nova-icons-react
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
4
We support two types of icons:
We also support multiple ways of consuming icons:
Our package follows security best practices and ensures the safety of user data. It relies on a minimal number of dependencies, minimizing potential vulnerabilities.
Available Packages:
@visa/nova-icons-angular
@visa/nova-icons-react
@visa/nova-icons-sprite
@visa/nova-icons-svg
Available through the NPM.
npm i @visa/nova-icons-angular
npm i @visa/nova-icons-react
npm i @visa/nova-icons-sprite
npm i @visa/nova-icons-svg
pnpm i @visa/nova-icons-angular
pnpm i @visa/nova-icons-react
pnpm i @visa/nova-icons-sprite
pnpm i @visa/nova-icons-svg
yarn add @visa/nova-icons-angular
yarn add @visa/nova-icons-react
yarn add @visa/nova-icons-sprite
yarn add @visa/nova-icons-svg
View our package.json for the most up-to-date dependencies, including peer dependencies and dev dependencies.
Package: @visa/nova-icons-angular
Supported Angular Versions: 16 - 19
For Angular, we built out each icon to be a standalone component. We also have all icons wrapped inside Angular modules for each icon type (Generic and Visa). This allows you to pick and chose which icons you'd like or if you want an entire icon type you can also import it's module. We architected the library to allow for deep tree shaking so the icons you use should be the only ones that get bundled with your app. This reduces build and load times as well as app sizes. The Angular library also supports Typescript out of the box.
If you only need a few icons you can simply import them directly. For this example we will be using a standalone component. First import the desired icon from @visa/nova-icons-angular
. Then use it inside your HTML.
my-component.component.ts
:
1import { Component } from "@angular/core"; 2import { GenericAccessabilityLow, GenericCalendarTiny } from "@visa/nova-icons-angular"; 3@Component({ 4 selector: "simple-my-component", 5 templateUrl: "./my-component.component.html", 6 standalone: true, 7 imports: [GenericAccessabilityLow, GenericCalendarTiny], 8}) 9export class MyComponent {}
my-component.component.html
:
1<div class="my-component"> 2 <svg v-icon-generic-accessability-low /> 3 <svg v-icon-generic-calendar-tiny /> 4</div>
If you need a lot of icons or just want a single simple import you can use the angular icon modules. For this example we will be using a standalone component. First import the desired icons module from @visa/nova-icons-angular
. Then use the icons directly inside your HTML.
my-component.component.ts
:
1import { Component } from "@angular/core"; 2import { NovaIconsGenericModule } from "@visa/nova-icons-angular"; 3@Component({ 4 selector: "simple-my-component", 5 templateUrl: "./my-component.component.html", 6 standalone: true, 7 imports: [NovaIconsGenericModule], 8}) 9export class MyComponent {}
my-component.component.html
:
1<div class="my-component"> 2 <svg v-icon-generic-accessability-low /> 3 <svg v-icon-generic-calendar-tiny /> 4</div>
We support right to left (RTL) out of the box. Simply pass the rtl
prop and the icon will flip horizontally when the html direction is set to rtl
.
For more info on RTL support we have some helpful resources listed in the Helpful Angular resources section.
my-component.component.html
:
1<div class="my-component"> 2 <svg v-icon-generic-connect-low rtl /> 3</div>
Package: visa_nova_icons_flutter
For Flutter, we have converted all sprites into a Dart file that contains all icons' SVG strings. This allows you to pick and choose which icons you'd like. We architected the library to allow tree shaking so the icons you use should be the only ones that get bundled with your app. This reduces build and load times as well as app sizes. The Flutter library supports strict typing and null safety out of the box and is built with the newest versions of Flutter and Dart SDKs.
Add the following to your pubspec.yaml
file under dependencies
. Then run flutter pub get
.
1dependencies: 2 visa_nova_icons_flutter: 3 version: ^3.0.0 4 hosted: 5 name: visa_nova_icons_flutter 6 url: https://artifactory.trusted.visa.com/api/pub/flutter-commons
We've built some helpful tools for using the icons library inside our components library. To best use the icon, import the library along side our visa_nova_flutter
library.
1import 'package:visa_nova_icons_flutter/visa_nova_icons_flutter.dart'; 2import 'package:visa_nova_flutter/visa_nova_flutter.dart'; 3import 'package:flutter/material.dart'; 4 5class MyGenericIconWidget extends StatelessWidget { 6 @override 7 Widget build(BuildContext context) { 8 return Container( 9 child: VIcon( 10 svgIcon: VIconsGeneric.launchLow, 11 ), 12 ); 13 } 14} 15 16class MyVisaIconWidget extends StatelessWidget { 17 @override 18 Widget build(BuildContext context) { 19 return Container( 20 child: VIcon( 21 iconColor: VColors.positiveGraphics, 22 svgIcon: VIcons.successTiny, 23 ), 24 ); 25 } 26}
Package: @visa/nova-icons-react
Supported React Versions: 18 - 19
For React, we built out each icon to be a React component. This allows you to pick and chose which icons you'd like. We architected the library to allow for deep tree shaking so the icons you use should be the only ones that get bundled with your app. This reduces build and load times as well as app sizes. The React library also supports Typescript out of the box. We also have support for all SVG properties and refs.
Install the package then simply import the desired icons directly from @visa/nova-icons-react
. Then use it as a component inside your JSX.
my-component.tsx
:
1import { GenericAccessibilityLow, GenericCalendarTiny } from "@visa/nova-icons-react"; 2 3export const MyComponent = () => ( 4 <div> 5 MyComponent 6 <GenericAccessibilityLow /> 7 <GenericCalendarTiny /> 8 </div> 9);
We support right to left (RTL) out of the box. Simply pass the rtl
prop and the icon will flip horizontally when the html direction is set to rtl
.
For more info on RTL support we have some helpful resources listed in the Helpful React resources section.
1import { GenericAccessibilityLow, GenericCalendarTiny } from "@visa/nova-icons-react"; 2 3export const MyComponent = () => ( 4 <> 5 {/** This icon will flip on right to left: */} 6 <GenericAccessibilityLow rtl /> 7 8 {/** This icon will NOT flip: */} 9 <GenericCalendarTiny /> 10 </> 11);
Package: @visa/nova-icons-sprite
A sprite is a collection of SVG icons composed into a single file. This method is often used to allow for a single server request for all icons. This is the most efficient way of displaying large numbers of icons, if it is determines most icons will be used during a session.
Example of a sprite:
1<svg class="v-icons v-icons-generic"> 2 <symbol 3 id="calendar--low" 4 class="v-icon v-icon-generic v-icon-low v-icon-calendar" 5 width="24" 6 height="25" 7 viewBox="0 0 24 25" 8 > 9 <path 10 fill-rule="evenodd" 11 clip-rule="evenodd" 12 d="M44.5051 5H35.0051V1.5C35.0051 0.672 34.3331 0 33.5051 0C32.6771 0 32.0051 0.672 32.0051" 13 class="v-icon-primary" 14 /> 15 </symbol> 16 <symbol 17 id="calendar--tiny" 18 class="v-icon v-icon-generic v-icon-tiny v-icon-calendar" 19 width="16" 20 height="16" 21 viewBox="0 0 16 16" 22 > 23 <path 24 fill-rule="evenodd" 25 clip-rule="evenodd" 26 d="M44.5051 5H35.0051V1.5C35.0051 0.672 34.3331 0 33.5051 0C32.6771 0 32.0051 0.672 32.0051" 27 class="v-icon-primary" 28 /> 29 </symbol> 30 <symbol 31 id="information--high" 32 class="v-icon v-icon-generic v-icon-high v-icon-information" 33 width="49" 34 height="48" 35 viewBox="0 0 49 48" 36 > 37 <path 38 fill-rule="evenodd" 39 clip-rule="evenodd" 40 d="M44.5051 5H35.0051V1.5C35.0051 0.672 34.3331 0 33.5051 0C32.6771 0 32.0051 0.672 32.0051" 41 class="v-icon-primary" 42 /> 43 </symbol> 44 <!-- ...MANY MORE SYMBOLS... --> 45</svg>
First you need to embed the sprite into your root element, or the highest scope needed to access the icons from children elements. You will then want to hide the sprite through this CSS: display: none;
. Once embedded you can now link to your sprite by leveraging the id of the symbol you wish to add to your application, as seen bellow. You can add any class to the SVG to style it properly. The default class should be v-icon
prefix with a no qualifier, category, size, and name all as separate classes with said prefix.
<svg class="v-icon v-icon-generic v-icon-tiny v-icon-calendar" height="16px" width="16px">
<use href="#calendar--tiny" xlink:href="#calendar--tiny"/>
</svg>
After installing the @visa/nova-icons-sprite
library you can import the sprite files directly.
// ESM:
import GenericSprite from "@visa/nova-icons-sprite/generic.svg";
import VisaSprite from "@visa/nova-icons-sprite/visa.svg";
// CommonJS:
const GenericSprite = require("@visa/nova-icons-sprite/generic.svg");
const VisaSprite = require("@visa/nova-icons-sprite/visa.svg");
Package: @visa/nova-icons-svg
SVG stands for Scalable Vector Graphics. It's a type of image format that's based on XML (a way of structuring data) and is used to create two-dimensional graphics. The key feature of SVGs is that they are scalable, which means they can be resized without losing any quality. This makes them ideal for use on the web where images need to look good on a variety of screen sizes and resolutions. They are also much smaller in size than JPEGs and PNGs.
Example of an SVG:
1<svg 2 class="v-icon v-icon-generic v-icon-tiny v-icon-checkmark" 3 width="16" 4 height="16" 5 viewBox="0 0 16 16" 6 xmlns="http://www.w3.org/2000/svg" 7> 8 <path 9 class="v-icon-primary" 10 fill-rule="evenodd" 11 clip-rule="evenodd" 12 d="M13.7205 3.29397C13.3331 2.90266 12.7519 2.90266 12.3644 3.29397L5.97141 9.75049L3.64668 7.40266C3.25923 7.01136 2.67805 7.01136 2.29059 7.40266C1.90314 7.79397 1.90314 8.38092 2.29059 8.77223L5.1965 11.707C5.58396 12.0983 6.16514 12.0983 6.55259 11.707L13.6236 4.56571C14.108 4.27223 14.108 3.58744 13.7205 3.29397Z" 13 /> 14</svg>
WCAG requires icons to use a contrast ratio of 4.5:1 between the icon and background color. You can verify contrast with various browser dev tools such as "Lighthouse" and "axe DevTools". To recolor the icons globally you can leverage the built in CSS classes, like "v-icon-primary" and "v-icon-secondary" these allow you to map the fill color to a CSS variable or a specific color. You can also specify which color you want mapped to each category of icon. Generic icons only have one color v-icon-primary
. Visa icons have two colors: v-icon-primary
, and v-icon-secondary
.
1.v-icon-primary { 2 fill: black; 3} 4.v-icon-generic .v-icon-primary { 5 fill: blue; 6} 7.v-icon-visa .v-icon-secondary { 8 fill: gold; 9}
HTML supports SVGs out of the box so you simply paste your SVG inside your desired html.
1<!DOCTYPE html> 2<html> 3 <head> 4 <title>My Simple HTML Page</title> 5 </head> 6 <body> 7 <h1>Welcome to My Website!</h1> 8 <p>This is a simple HTML document.</p> 9 <!-- SEE THIS LINE: --> 10 <svg 11 class="v-icon v-icon-generic v-icon-tiny v-icon-checkmark" 12 width="16" 13 height="16" 14 viewBox="0 0 16 16" 15 xmlns="http://www.w3.org/2000/svg" 16 > 17 <path 18 class="v-icon-primary" 19 fill-rule="evenodd" 20 clip-rule="evenodd" 21 d="M13.7205 3.29397C13.3331 2.90266 12.7519 2.90266 12.3644 3.29397L5.97141 9.75049L3.64668 7.40266C3.25923 7.01136 2.67805 7.01136 2.29059 7.40266C1.90314 7.79397 1.90314 8.38092 2.29059 8.77223L5.1965 11.707C5.58396 12.0983 6.16514 12.0983 6.55259 11.707L13.6236 4.56571C14.108 4.27223 14.108 3.58744 13.7205 3.29397Z" 22 /> 23 </svg> 24 </body> 25</html>
After installing the @visa/nova-icons-svg
library you can import the SVG files directly.
1// ESM: 2import GenericAccessabilityLow from "@visa/nova-icons-svg/generic/accessability-low.svg"; 3import GenericCalendarTiny from "@visa/nova-icons-svg/generic/calendar-tiny.svg"; 4 5// CommonJS: 6const GenericAccessabilityLow = require("@visa/nova-icons-svg/generic/accessability-low.svg"); 7const GenericCalendarTiny = require("@visa/nova-icons-svg/generic/calendar-tiny.svg");
We support right to left (RTL) out of the box. Simply pass the v-icon-rtl
class to the classes and the icon will flip horizontally when the html direction is set to rtl
. For more info on RTL support we have some helpful resources listed in the Helpful SVG resources section.
1<svg 2 class="v-icon v-icon-generic v-icon-tiny v-icon-checkmark v-icon-rtl" 3 width="16" 4 height="16" 5 viewBox="0 0 16 16" 6 xmlns="http://www.w3.org/2000/svg" 7> 8 <path 9 class="v-icon-primary" 10 fill-rule="evenodd" 11 clip-rule="evenodd" 12 d="M13.7205 3.29397C13.3331 2.90266 12.7519 2.90266 12.3644 3.29397L5.97141 9.75049L3.64668 7.40266C3.25923 7.01136 2.67805 7.01136 2.29059 7.40266C1.90314 7.79397 1.90314 8.38092 2.29059 8.77223L5.1965 11.707C5.58396 12.0983 6.16514 12.0983 6.55259 11.707L13.6236 4.56571C14.108 4.27223 14.108 3.58744 13.7205 3.29397Z" 13 /> 14</svg>
Our extensive library features a vast array of icons meticulously crafted by our talented designers. Whether you need icons for accessibility, navigation, or specific branding, our collection has you covered. With Nova icons, you can effortlessly enhance your application's user interface with beautifully designed, purpose-driven icons.
Nova icons are designed to be compatible with multiple platforms, including Angular, Flutter, React, and plain SVG files. This ensures that no matter what technology stack you are using, you can easily integrate our icons into your project.
We prioritize accessibility in our icon design, ensuring that all icons meet WCAG standards. This includes providing sufficient contrast and supporting right-to-left (RTL) languages out of the box. Our icons are designed to be inclusive and usable by everyone.
We conduct rigorous testing to ensure our icons work seamlessly across all supported platforms, including Angular, Flutter, React, and plain SVG files.
Our goal is to achieve 100% test coverage for all icons. Our pipeline safeguards against merging any code that fails our tests, ensuring that our icons remain reliable and consistent across all platforms.
This project is maintained by the Visa Product Design System engineering team. If you need to get in touch please reach out to us via any of our options on our support page.
Thanks to all those who have contributed and to the Visa Product Design team for all of the hours and thought that have gone into making the design system as easy to use as possible.
SEE CONTRIBUTING.md
SEE LICENSE IN LICENSE
No vulnerabilities found.
No security vulnerabilities found.