Socket
Book a DemoInstallSign in
Socket

react-file-icon

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-file-icon

React component to render svg file icons

1.6.0
latest
Source
npmnpm
Version published
Weekly downloads
105K
2.74%
Maintainers
1
Weekly downloads
 
Created
Source

React File Icon

npm version gh workflow

CodeSandbox demo with default icon styles.

import { FileIcon } from 'react-file-icon';

Props

PropertyTypeDefaultDescription
colorstringwhitesmokeColor of icon background
extensionstringundefinedText to display in label
foldbooltrueDisplays the corner fold
foldColorstringundefinedColor of the corner fold
glyphColorstringundefinedColor of file type icon
gradientColorstringwhiteColor of page gradient
gradientOpacitynumber0.25Opacity of page gradient
labelColorstringundefinedColor of label
labelTextColorstringwhiteColor of label text
labelUppercaseboolfalseDisplays the label in all caps
radiusnumber4Corner radius of the file icon
typeenumundefinedType of glyph icon to display (One of: 3d, acrobat, android, audio, binary, code, compressed, document, drive, font, image, presentation, settings, spreadsheet, vector, video)

Default Styles

We also export an object of default styles that can be used as a starting point when rendering icons. Object keys map to file extensions.

import { FileIcon, defaultStyles } from 'react-file-icon';

// Render a .docx icon with default styles
<FileIcon extension="docx" {...defaultStyles.docx} />;

Keywords

react

FAQs

Package last updated on 14 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.