
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@bolttech/atoms-file-upload
Advanced tools
A simple React component for file uploads, supporting both traditional input and drag & drop.
A simple React component for file uploads, supporting both traditional input and drag & drop.
Use npm or yarn to install the component.
npm install @bolttech/frontend-foundations @bolttech/atoms-file-upload
or
yarn add @bolttech/frontend-foundations @bolttech/atoms-file-upload
The FileUpload component accepts the following properties:
| Prop | Type | Description |
|---|---|---|
| id | string | The ID attribute for the upload element. |
| dataTestId | string | Identifier for automated tests. |
| text | string | Label text for the upload. |
| dragActiveText | string | Text displayed when files are dragged over the dropzone. |
| variant | string | Upload type: 'input' or 'dropzone'. |
| accept | string | Accepted file types (e.g., 'image/png'). |
| multiple | boolean | Allows selection of multiple files. |
| disabled | boolean | Disables the component. |
| value | File[] | List of selected files. |
| errorMessage | string | Custom error message. |
| onChange | function | Callback to handle selected files. |
import React, { useState } from 'react';
import { FileUpload } from '@bolttech/atoms-file-upload';
import { bolttechTheme, BolttechThemeProvider } from '@bolttech/frontend-foundations';
const ExampleComponent = () => {
const [files, setFiles] = useState([]);
const handleFileChange = async (selectedFiles) => {
setFiles(selectedFiles);
// Return an array of objects { file, success, message }
return selectedFiles.map(file => ({
file,
success: true,
message: `${file.name} uploaded successfully`
}));
};
return (
<BolttechThemeProvider theme={bolttechTheme}>
<FileUpload
id="custom-file-upload"
text="Select or drag files"
variant="dropzone"
multiple
value={files}
onChange={handleFileChange}
/>
</BolttechThemeProvider>
);
};
export default ExampleComponent;
Contributions are welcome! For bug fixes, improvements, or new features, please open an issue or submit a pull request.
Please make sure to follow the code standards and test your
FAQs
A simple React component for file uploads, supporting both traditional input and drag & drop.
We found that @bolttech/atoms-file-upload demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 open source maintainers 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
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.