wix-style-react
Version:
44 lines (43 loc) • 1.64 kB
JavaScript
export default {
description:
'The file upload component allows users to upload a single or multiple files at a time. It’s a wrapper component that prompts a native file upload dialog on trigger click.',
do: [
'Use it to upload text or media files',
'Use it to upload a single or multiple files at once',
'Use it to apply a file selection mechanism to existing components like <AddItem/>',
],
dont: [
"Don't use it as a standalone item. It must wrap a trigger component. For a standalone solution use the <FilePicker/> instead.",
],
featureExamples: [
{
title: 'Structure',
description: `Render the file selection trigger as a child item of this component. Any component can be passed as a trigger element.`,
example: '_structure',
},
{
title: 'File types',
description: `Define the files types that could be uploaded with the \`accept\` prop. Separate formats with a comma.`,
example: '_fileTypes',
},
{
title: 'Multiple files',
description: `Enables selecting and uploading multiple files at once with the \`multiple\` prop.`,
example: '_multipleFiles',
},
],
commonUseCaseExamples: [
{
title: 'Trigger elements',
description: `The file upload wrapper can trigger a selection dialog via any component from the library.
Buttons or viewer components that have predefined interaction states and are accessible with the keyboard should be used instead.`,
example: '_triggerElements',
},
{
example: '_addImageCase',
},
{
example: '_attachmentsCase',
},
],
};