
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
@builtwithjavascript/react-file-upload-tailwind
Advanced tools
A React file upload component with validation, styled with Tailwind CSS
A React file upload component with validation, styled with Tailwind CSS.
npm i -D @builtwithjavascript/react-file-upload-tailwind
import { FileUploadComponent } from '@builtwithjavascript/react-file-upload-tailwind'
import type {
IFileInfo,
IFileValidatorOptions
} from '@builtwithjavascript/react-file-upload-tailwind'
const fileValidatorOptions: IFileValidatorOptions = {
allowedTypes: ['csv', 'xls'],
maxSize: 50, // in MB
maxNameLength: 60, // max name length in chars
nameTruncateMaxLength: 35, // will truncate the display of the name
propertiesToValidate: ['name', 'type', 'size']
}
const onUploadClick = async (fileInfo: IFileInfo) => {
// do what you need to do with fileInfo.file
// i.e. create form data and post it to an API endpoint
const file = new FormData()
file.append('file', fileInfo.file as Blob)
const response = await someApiClient.post({
file: file
})
...
}
...
<FileUploadComponent id="my-file-upload"
uploadLabel="Import file"
validatorOptions={fileValidatorOptions}
showOnlyErrors={true}
roundedCorners={true}
onUploadClick={onUploadClick}
/>
NOTE: if you pass showOnlyErrors true, that only the validator items that fail will be displayed.
FAQs
A React file upload component with validation, styled with Tailwind CSS
The npm package @builtwithjavascript/react-file-upload-tailwind receives a total of 0 weekly downloads. As such, @builtwithjavascript/react-file-upload-tailwind popularity was classified as not popular.
We found that @builtwithjavascript/react-file-upload-tailwind demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.