Skip to content

zctcode/react-file-picker

Repository files navigation

@ihatecode/react-file-picker

Englist | 中文

npm npm GitHub forks GitHub Repo stars

Introduction

A file picker component written in React.

Install

# npm
npm install @ihatecode/react-file-picker
# yarn
yarn add @ihatecode/react-file-picker
# pnpm
pnpm add @ihatecode/react-file-picker

Usage

import React from 'react';
import FilePicker from '@ihatecode/react-file-picker';
import '@ihatecode/react-file-picker/lib/style.css';

const App: React.FC = () => {
  return (
    <FilePicker
        multiple
        accept="image/*"
        onChange={(files) => console.log(files)}
    >
      <span>Select files</span>
    </FilePicker>
  );
};

export default App;

Demo

Online demo: https://pjzpz7.csb.app/

Edit react-splitter

Props

Property Type Optional
className string Y
style object Y
accept string Y
multiple boolean Y
directory boolean Y
draggable boolean Y
children any Y
onChange (files: FileList) => void Y

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published