Socket
Book a DemoInstallSign in
Socket

@uploadcare/react-widget

Package Overview
Dependencies
Maintainers
2
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uploadcare/react-widget

React component for Uploadcare Widget

Source
npmnpm
Version
0.2.0-1
Version published
Weekly downloads
5.6K
1%
Maintainers
2
Weekly downloads
 
Created
Source

React Widget

Build Status NPM version

React component for uploadcare widget

This library comes untranspiled

Want to support IE11 → make sure you transpile node_modules.

Install

npm i @uploadcare/react-widget

Usage

import { Widget } from "@uploadcare/react-widget";

<Widget publicKey="demopublickey" />;

Available props

All the props except for the listed below are passed down to the widget. See widget documentation for the details.

value: string

Set a file/group UUID or a CDN link as a value.

<Widget value='9dd2f080-cc52-442d-aa06-1d9eec7f40d1' />
<Widget value='9dd2f080-cc52-442d-aa06-1d9eec7f40d1~12' />
<Widget value={null} />

onFileSelect: (fileInfo: FileInfo) => void

onChange: (fileInfo: FileInfo) => void

FileInfo object is described here

customTabs: {[string]: CustomTabConstructor}

Set a custom tabs for a widget.

Note that we're added fifth argument to the custom tab constructor - uploadcare object. Widget is loaded lazily so you shouldn't import uploadcare-widget directly.

function myTab(container, button, dialogApi, settings, name, uploadcare) {
  ...
}

<Widget customTabs={{ 'custom_tab: myTab }} />

validator

Examples

Keywords

react

FAQs

Package last updated on 01 Aug 2019

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