Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@danielr18/react-file-icon

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@danielr18/react-file-icon

React component to render svg file icons

  • 1.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
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, 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

FAQs

Package last updated on 08 Jul 2022

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc