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

click-select-input

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

click-select-input

click on div or box to select media files

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

File select input on click

use this to create your own customize file input box.

Online Demo

npm install customize-file-input

Requirements

import React, {useState, useEffect} from 'react'
import FileInput from 'customize-file-input'

function App() {
  const [files, setfiles]= useState([])
  console.log(files)
  return (
    <div>
      <FileInput getFiles={setfiles}/>
    </div>
  );
}

export default App;


properties :-



nameisRequiredtypeexampleabout
getFilesrequiredfunction or setStateconst [data, setData] = useState('') const or data = (files)=>{console.log(files)}getFiles is a callBack function that returns files.
clickableViewnot requiredhtml_function()clickableView=()={return html}clickableView is a function in which html is sent, on which the file input of the clickable view is activated.
acceptnot required'string'accept = accept="image/*"Accept tells what type of file you want to select.
boxStylenot requiredstyle objectboxStyle = {{background:'red'}}The input file box will be styled with BoxStyle.
limitnot requirednumberlimit = {10}set max file select limit
viewUploadedFilesnot requiredboolviewUploadedFiles = {true}If you want to preview the uploaded file then it can be true viewUploadedFiles
loopnot requiredboolloop ={true}You can put a loop if you want to play the uploaded video or audio over and over again.
mediaBoxStylenot requiredstyle objectmediaBoxStyle = {{background:'red'}}view uploaded media box style
mediaStylenot requiredstyle objectmediaStyle = {{background:'red'}}uploaded media files style
videoAutoplaynot requiredboolvideoAutoplay = {true}autoPlay uploaded video files
audioAutoplaynot requiredboolaudioAutoplay = {true}atoplay uploaded Audio files
muteVideonot requiredboolmuteVideo = {true}mute autoPlay video file
muteAudionot requiredboolmuteAudio = {true}mute autoPlay audio file
boxClassnot requiredstringboxClass = 'className'uploaded files div class
multiplenot requiredboolmultiple = {true}select multiple files

Keywords

FAQs

Package last updated on 19 Sep 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