react-sick-file-icon
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

react-sick-file-icon

A hacky library to render icons for files in React.

Supports all file types from the File Icons project (from Atom and VSCode extensions) -- hundreds! The implementation internally uses a slightly trimmed down version of the data for the VSCode extension.

The icon is automatically determined based on the filename. Do not include path components.

Currently, only light mode is supported. Folder icons are not supported, except the default "boring" one.

To change the size of the icon, apply a font-size CSS.

Install

npm install --save react-sick-file-icon

Your bundler must support CSS and woff2 files. In esbuild, this means:

npx esbuild ... --bundle --loader:.woff2=file ...

Usage

import { SickFileIcon } from "react-sick-file-icon";
import "react-sick-file-icon/src/icons.css";

...

<SickFileIcon filename={"hello.jsx"} isFolder={false} />

Readme

Keywords

none

Package Sidebar

Install

npm i react-sick-file-icon

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

3.45 MB

Total Files

19

Last publish

Collaborators

  • tmickel