
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
vfs-upload-widget
Advanced tools
npm install egov-upload-widget
import 'egov-upload-widget/styles';
![]()
The Avatar Uploader component allows users to upload and display avatars in your React application.
import Avatar from 'egov-upload-widget/avatar';
//or
import Avatar from 'egov-upload-widget/avatar-circle';
<Avatar
project="project_name"
name="avatar"
value="https://example.com/avatar.jpg"
maxFileSize={1048576} // 1MB
onChange={(e) => console.log(e.target.value)}
onDelete={() => {}}
customRender={<CustomAvatarComponent />}
/>
import React, { useState } from 'react';
import Avatar from 'egov-upload-widget/avatar';
const App = () => {
const [value, setValue] = useState('');
const onHandleChange = (e) => {
setValue(e.target.value.url);
};
return (
<div>
<Avatar
project="project_name"
name="avatar"
value={value}
maxFileSize={5242880} // 5MB
onchange={onHandleChange}
/>
</div>
);
};
export default App;
customRender PropThe customRender prop allows you to specify a custom React component for rendering the avatar. This gives you full control over the appearance and behavior of the avatar component. The custom component will receive the following props:
import React from 'react';
const CustomAvatarComponent = ({
onToggleMenu,
data,
progressPercentage,
error,
isShowMenu,
setIsShowMenu,
onHandleDelete,
MenuComponent
}) => {
return (
...
)
}
const App = () => {
return (
<Avatar
project="project_name"
name="avatar"
value={avatarUrl}
maxFileSize={5242880} // 5MB
onchange={onHandleChange}
customRender={(props) => (
<CustomAvatarComponent />
)}
/>
);
};
export default App;

The Single File Uploader component allows users to upload and display file in your React application.
import File from 'egov-upload-widget/file';
<File
project="project_name"
name="file"
value={{
file_name: 'file.jpg',
url: 'https://example.com/file.jpg',
mime_type: 'application/jpeg'
}}
maxFileSize={1048576} // 1MB
onchange={(e) => console.log(e.target.value.url)}
customRender={<CustomAvatarComponent />}
/>
import React, { useState } from 'react';
import File from 'egov-upload-widget/file';
const App = () => {
const [value, setValue] = useState('');
const onHandleChange = (e) => {
setValue(e.target.value);
};
return (
<div>
<File
project="project_name"
name="file"
value={value}
maxFileSize={5242880} // 5MB
onchange={onHandleChange}
/>
</div>
);
};
export default App;
customRender PropThe customRender prop allows you to specify a custom React component for rendering the file. This gives you full control over the appearance and behavior of the file component. The custom component will receive the following props:
import React from 'react';
const CustomFileComponent = ({
onToggleMenu,
data,
progressPercentage,
error,
isShowMenu,
setIsShowMenu,
onHandleDelete,
MenuComponent
}) => {
return (
...
)
}
const App = () => {
return (
<File
project="project_name"
name="file"
value={value}
maxFileSize={5242880} // 5MB
onchange={onHandleChange}
customRender={(props) => (
<CustomFileComponent />
)}
/>
);
};
export default App;

The Multiple File Uploader component allows users to upload and display files in your React application.
import Files from 'egov-upload-widget/files';
<Files
project="project_name"
name="files"
value={[
{
file_name: 'file.jpg',
url: 'https://example.com/file.jpg',
mime_type: 'application/jpeg'
},
{
file_name: 'file2.jpg',
url: 'https://example.com/file2.jpg',
mime_type: 'application/jpeg'
},
{
file_name: 'file3.pdf',
url: 'https://example.com/file3.jpg',
mime_type: 'application/pdf'
}
]}
maxFileSize={1048576} // 1MB
onchange={(e) => {
//array of files
console.log(e.target.value)
}}
customRender={<CustomAvatarComponent />}
/>
import React, { useState } from 'react';
import Files from 'egov-upload-widget/files';
const App = () => {
const [value, setValue] = useState('');
const onHandleChange = (e) => {
//array of files
setValue(e.target.value);
};
return (
<div>
<Files
project="project_name"
name="files"
value={value}
maxFileSize={5242880} // 5MB
onchange={onHandleChange}
/>
</div>
);
};
export default App;
customRender PropThe customRender prop allows you to specify a custom React component for rendering the file. This gives you full control over the appearance and behavior of the file component. The custom component will receive the following props:
import React from 'react';
const CustomFileComponent = ({
onToggleMenu,
data,
progressPercentage,
error,
isShowMenu,
setIsShowMenu,
onHandleDelete,
MenuComponent
}) => {
return (
...
)
}
const App = () => {
return (
<Files
project="project_name"
name="files"
value={value}
maxFileSize={5242880} // 5MB
onchange={onHandleChange}
customRender={(props) => (
<CustomFileComponent />
)}
/>
);
};
export default App;
FAQs
VFS upload widget for reactjs
The npm package vfs-upload-widget receives a total of 0 weekly downloads. As such, vfs-upload-widget popularity was classified as not popular.
We found that vfs-upload-widget 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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.