1.1.6 • Published 12 months ago

react-extension-icons v1.1.6

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months ago

React Extension Icons

Description

A library for rendering file extension icons in React. This package provides SVG icons for various file extensions with three variants: color, single_color, and grayscale.

Installation

npm install react-extension-icons

Usage

Basic Usage

You can use the Icon component to render icons based on file extensions.

import React from 'react';
import { Icon } from 'react-extension-icons';

const App: React.FC = () => {
  return (
    <div>
      <Icon extension="pdf" variant="color" size={48} className="custom-class" />
      <Icon extension="docx" variant="single_color" size={48} color="blue" />
      <Icon extension="jpg" variant="grayscale" size={48} />
    </div>
  );
};

export default App;

Individual Icons

You can also use individual icon components if you prefer to import them directly.

import React from 'react';
import { PdfIconColor, DocxIconSingleColor, JpgIconGrayscale } from 'react-extension-icons';

const App: React.FC = () => {
  return (
    <div>
      <PdfIconColor width={48} height={48} className="custom-class" />
      <DocxIconSingleColor width={48} height={48} color="blue" />
      <JpgIconGrayscale width={48} height={48} />
    </div>
  );
};

export default App;

Props

Icon

PropTypeDefaultDescription
extensionstringThe file extension to render the icon for.
variant'color' \| 'single_color' \| 'grayscale''color'The variant of the icon to render.
sizenumber24The size of the icon.
classNamestring''Additional CSS classes to apply to the icon.
colorstring''The color of the icon (applies only to single_color variant).

Individual Icon Components

All individual icon components accept the following props: | Prop | Type | Default | Description | |------------|------------|-----------|------------------------------------------------| | width | number | 24 | The width of the icon. | | height | number | 24 | The height of the icon. | | className | string | '' | Additional CSS classes to apply to the icon. | | color | string | '' | The color of the icon (applies only to single_color variant). |

Supported Extensions

This package supports the following file extensions:

VariantsIcon
aiIcon
aviIcon
bmpIcon
crdIcon
csvIcon
dllIcon
doc, docxIcon
dwg, dxfIcon
epsIcon
exeIcon
flvIcon
gifIcon
html, htmIcon
isoIcon
java, jarIcon
jpg, jpeg, jpe, jif, jfif, jfiIcon
mdbIcon
mid, midiIcon
mov, qtIcon
mp3Icon
mp4, m4a, m4pIcon
mpeg, mpg, mp2, mpe, mpvIcon
pdfIcon
pngIcon
ppt, pptx, pps, ppsx, potx, potm, ppsm, ppam, sldx, sldmIcon
psIcon
psdIcon
pubIcon
rarIcon
rawIcon
rssIcon
svgIcon
tiff, tifIcon
txtIcon
wavIcon
wma, wmvIcon
xmlIcon
xslIcon
zipIcon

Credits

Icons are sourced from this Figma file created by Graphy.

License

This project is licensed under the ISC License.

1.1.6

12 months ago

1.1.2

12 months ago

1.1.1

12 months ago

1.0.91

12 months ago

1.0.90

12 months ago

1.0.89

12 months ago

1.0.88

12 months ago

1.0.87

12 months ago

1.0.86

12 months ago

1.0.85

12 months ago

1.0.84

12 months ago

1.0.83

12 months ago

1.0.82

12 months ago

1.0.81

12 months ago

1.0.80

12 months ago

1.0.79

12 months ago

1.0.77

12 months ago

1.0.76

12 months ago

1.0.75

12 months ago

1.0.74

12 months ago

1.0.73

12 months ago

1.0.72

12 months ago

1.0.71

12 months ago

1.0.70

12 months ago

1.0.69

12 months ago

1.0.68

12 months ago

1.0.67

12 months ago

1.0.66

12 months ago

1.0.63

12 months ago

1.0.61

12 months ago

1.0.57

12 months ago

1.0.51

12 months ago

1.0.50

12 months ago

1.0.49

12 months ago

1.0.45

12 months ago

1.0.42

12 months ago

1.0.40

12 months ago

1.0.37

12 months ago

1.0.35

12 months ago

1.0.26

12 months ago

1.0.24

12 months ago

1.0.23

12 months ago

1.0.21

12 months ago

1.0.11

12 months ago

1.0.10

12 months ago

1.0.9

12 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.5

12 months ago

1.0.3

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago