1.1.1 • Published 8 months ago

@threeveloper/azure-react-icons v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@threeveloper/azure-react-icons

npm.io

Installation

npm install @threeveloper/azure-react-icons

Note: react@>=16 needs to be installed in your project.

Usage

Display a single icon

Using a single icon is as simple as:

import { AIStudio } from '@threeveloper/azure-react-icons';

<AIStudio /> // Default size 16    
<AIStudio size="24" /> // Custom size

Display all icons in a category

The Azure icons are separated into categories (managed by Microsoft). Each category has a label and a components property, which contains all the icons in that category.

import { AiMachineLearning } from '@threeveloper/azure-react-icons';

export const AllIconsInAiMachineLearningCategory = () => (
    <>
        <span>{AiMachineLearning.label}</span> // Prints "AI + Machine learning"

        {Object.values(AiMachineLearning.components).map((Icon) => (
            <Icon key={Icon.name} /> // Render all icons in this category
        ))}
    </>
);

Display all icons grouped by category

The default export of this library is an object containing all categories.

import AzureReactIcons from '@threeveloper/azure-react-icons';

export const AllIconsGroupedByCategory = () => (
    <div>
        {Object.values(AzureReactIcons).map((category) => (
            <div key={category.label}>
                <span>{category.label}</span>
                {Object.values(category.components).map((Icon) => (
                    <Icon key={Icon.name} /> // Renders all icons grouped by category
                ))}
            </div>
        ))}
    </div>
);

Thanks to @orangenet for the initial setup. This project provides a better DX, contains newer icons and TypeScript definitions.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Icon terms

Based on the Official Azure Icon terms:

Microsoft permits the use of these icons in architectural diagrams, training materials, or documentation. You may copy, distribute, and display the icons only for the permitted use unless granted explicit permission by Microsoft. Microsoft reserves all other rights.

2.0.0-alpha.3

8 months ago

2.0.0-alpha.4

8 months ago

2.0.0-alpha.2

8 months ago

2.0.0-alpha.1

8 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.0.0

9 months ago

0.1.0

9 months ago

0.0.4

9 months ago

0.0.3-alpha.2

9 months ago

0.0.3-alpha.1

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago