Amplify UI Storage components use Amplify Storage to allow your users to upload and interact with files stored in Amazon S3 with minimal boilerplate.
Quick start
The Amplify UI Storage components work seamlessly with the Amplify CLI to automatically work with your backend.
First, update @aws-amplify/cli
with npm or yarn
if you're using a version before 6.4.0
:
npm install -g @aws-amplify/cli@latest
yarn global add @aws-amplify/cli@latest
Now that you have the Amplify CLI installed, you can set up your Amplify project by running amplify init
in your project's root directory.
Then run amplify add storage
and follow the prompts to add storage to your backend configuration.
The Amplify Storage category requires you have auth set up. When you run amplify add storage
it will prompt you to add auth as well.
If you have an existing backend, run amplify pull
to sync your aws-exports.js
with your cloud backend.
You should now have an aws-exports.js
file in your src/
directory with your latest backend configuration.
After setting up Amplify make sure to install the Amplify libraries.
npm install @aws-amplify/ui-react-storage aws-amplify
yarn add @aws-amplify/ui-react-storage aws-amplify