0.2.1 • Published 7 months ago

react-native-file-icon v0.2.1

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

react-native-file-icon

React Native component that makes it easy to render themeable svg file icons. React Native version of react-file-icon. This library supports iOS, Android, and Web.

Demo

Expo Snack

Installation

npm install react-native-file-icon

or

yarn add react-native-file-icon

Dependencies

This library needs these dependencies to be installed in your project before you can use it:

yarn add react-native-svg

Using expo?

expo install react-native-svg

Usage

Default Style

We 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-native-file-icon';

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

Props

PropTypeDefaultDescription
colorstring'whitesmoke'The base color of the file icon.
extensionstringundefinedThe file extension that appears as a label on the icon.
foldbooleantrueDetermines whether to display a folded corner on the file icon.
foldColorstringundefinedThe color of the folded corner (if displayed).
glyphColorstringundefinedThe color of the icon glyph (if displayed).
gradientColorstring'white'The color of the gradient background behind the icon.
gradientOpacitynumber0.25The opacity of the gradient background behind the icon.
labelColorstringundefinedThe color of the label background on the icon.
labelTextColorstring'white'The color of the text on the label.
labelUppercasebooleanundefinedDetermines whether the label text should be displayed in uppercase.
radiusnumber4The corner radius of the file icon.
typeFileIconTypeundefinedThe type of the file icon, which corresponds to a specific glyph.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

0.2.1

7 months ago

0.2.0

7 months ago