New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@chainplatform/file

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chainplatform/file

The library allows you to select file with react-native without ejecting support both react-native and react-native-web.

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
0
Created
Source

React Native File Select

The library allows you to select file with react-native without ejecting support both react-native and react-native-web.

Current npm package version. PRs welcome! Follow @doansan

Prequisites

  • This library relies on React Native Webview. Please follow this guide to install in your project first.

Installation

  • Ensure you've completed the setps in prequisites.

  • Install package via npm or yarn:

npm install --save @chainplatform/file OR yarn add @chainplatform/file

  • If your project use react-native-web to build website:

npm install --save @chainplatform/react-native-web-webview OR yarn add @chainplatform/react-native-web-webview

Then setup by guide at: https://github.com/ChainPlatform/react-native-web-webview#readme

Usage

  • Import in your project
import FileSelect from '@chainplatform/file';
    <FileSelect
        style_button={`background: ${colors.green2}; 
          padding: ${styles.fs11}px ${styles.fs15}px; 
          font-size: ${styles.fs13}px; 
          font-weight: ${styles.fw600};
          border-radius: ${styles.s0}px;`
        }
        file_text={"Select file"}
        file_types={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,text/comma-separated-values, text/csv, application/csv"}
        getFile={(datas) => { 
            console.log("File ", datas);
        }}
    />

Component props

  • style_button (String) - Button style ({ background: "green"; padding: 12px; font-size: 13px; font-weight: 600; border-radius: 5px; })
  • file_text (String) - Button text.
  • file_types (String) - File type allowed ("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,text/comma-separated-values, text/csv, application/csv"...)
  • getFile (?Function) - Called upon calback of the file selected
  • Support full Webview props

Contributing

Pull requests are highly appreciated! For major changes, please open an issue first to discuss what you would like to change.

  • Other packages for react native and react native web: ChainPlatform

Keywords

react

FAQs

Package last updated on 21 Jan 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