Home

Awesome

antd-amplify-react

This is an Ant Design specific implementation of AWS Amplify React components for Authentication (SignUp, ConfirmSignUp, SignIn, SignOut, RequireNewPassword, ForgotPassword). You can use less and variables to style these components.

If you like this package and it helped you in any way, Star at github ⭐ ⭐ ⭐

Install

npm i -S antd-amplify-react

Usage

There are two components for each kind of component. One contains just Form and other contains the form component in Card container. e.g. there is a component SignInForm without any container and SignIn with Card container. If you want more hold on styling of your form outer container, user Form components inside your own containers.

There is a special component AuthFlow which contains all above mentioned components in a single container and it handles all authentication flows and changes UI according to auth state.

Here are following components that you can use:

<hr />

AuthFlow

<AuthFlow  />

AuthFlow

<AuthFlow
  tabPosition="top"
  signInFormProps={{
    hideSignUpLink: true,
    hideResetPasswordLink: true,
    usernameInputProps: {
      message: "Invalid username!"
    }
  }}
/>

AuthFlow

PropertyDescriptionTypeDefault
tabPositionSpecify tab positionstringtop
tabViewIn order to use tabs instead of radio group buttons (default view) for switching componentsboolfalse
colPropsAn object containing Col props to specify columns, offset etc. See moreobject{ xs: 24, sm: 12, md: 8 }
<hr />

SignIn

<SignIn />

SignIn

PropertyDescriptionTypeDefault
titleThe label text displayed in Card title/header section.string|ReactNodeSign in to your account
formPropsThis is an object containing SignInForm props that you want to modify.object{}
colPropsAn object containing Col props to specify columns, offset etc. See moreobject{ xs: 24, sm: 12, md: 8 }
<hr />

SignInForm

<SignInForm />
PropertyDescriptionTypeDefault
usernameInputPropsusername input field propsobject{ prefix: <Icon type="user" />, size: 'large', placeholder: 'Username', message: 'Please enter your username!' }
passwordInputPropspassword input field propsobject{ prefix: <Icon type="lock" />, size: 'large', placeholder: 'Password', message: 'Please enter your password!' }
buttonPropsSubmit button propsobject{ size: 'large', type: 'primary', label: 'Submit'}
hideSignUpLinkIn order to hide SignUp link in form, add this props.boolfalse
hideResetPasswordLinkIn order to hide ResetPassword link in form, add this props.boolfalse
<hr />

SignUp

<SignUp />

SignUp

PropertyDescriptionTypeDefault
titleThe label text displayed in Card title/header section.string|ReactNodeSign Up
formPropsThis is an object containing SignInForm props that you want to modify.object{}
colPropsAn object containing Col props to specify columns, offset etc. See moreobject{ xs: 24, sm: 12, md: 8 }
<hr />

SignUpForm

<SignUpForm />
PropertyDescriptionTypeDefault
usernameInputPropsusername input field propsobject{ prefix: <Icon type="user" />, size: 'large', placeholder: 'Email', message: 'Please enter your email!'}
passwordInputPropspassword input field propsobject{ prefix: <Icon type="lock" />, size: 'large', placeholder: 'Password', message: 'Please enter your password!'}
confirmPasswordInputPropsconfirm password input field propsobject{ prefix: <Icon type="lock" />, size: 'large', placeholder: 'Confirm', message: 'Please confirm your password!'}
buttonPropsSubmit button propsobject{ size: 'large', type: 'primary', label: 'Submit'}
confirmPasswordIn order to hide confirm password field, add false.booltrue
<hr />

ConfirmSignUp

<ConfirmSignUp />

ConfirmSignUp

PropertyDescriptionTypeDefault
titleThe label text displayed in Card title/header section.string|ReactNodeConfirm Sign Up
formPropsThis is an object containing SignInForm props that you want to modify.object{}
colPropsAn object containing Col props to specify columns, offset etc. See moreobject{ xs: 24, sm: 12, md: 8 }
<hr />

ConfirmSignUpForm

<ConfirmSignUpForm />
PropertyDescriptionTypeDefault
usernameInputPropsusername input field propsobject{ prefix: <Icon type="user" />, size: 'large', placeholder: 'Email', message: 'Please enter your email!'}
codeInputPropssecret code input field propsobject{ prefix: <Icon type="lock" />, size: 'large', placeholder: 'Enter your code', message: 'Please enter secret code!'}
buttonPropsSubmit button propsobject{ size: 'large', type: 'primary', label: 'Submit'}
<hr />

ResetPassword

<ResetPassword />

ResetPassword

PropertyDescriptionTypeDefault
titleThe label text displayed in Card title/header section.string|ReactNodeReset Password
formPropsThis is an object containing ResetPasswordForm props that you want to modify.object{}
colPropsAn object containing Col props to specify columns, offset etc. See moreobject{ xs: 24, sm: 12, md: 8 }
<hr />

ResetPasswordForm

<ResetPasswordForm />
PropertyDescriptionTypeDefault
usernameInputPropsusername input field propsobject{ prefix: <Icon type="user" />, size: 'large', placeholder: 'Email', message: 'Please enter your email!'}
passwordInputPropspassword input field propsobject{ prefix: <Icon type="lock" />, size: 'large', placeholder: 'Password', message: 'Please enter your password!'}
buttonPropsSubmit button propsobject{ size: 'large', type: 'primary', label: 'Submit'}
<hr />

RequireNewPassword

<RequireNewPassword />

RequireNewPassword

PropertyDescriptionTypeDefault
titleThe label text displayed in Card title/header section.string|ReactNodeChange Password
formPropsThis is an object containing ResetPasswordForm props that you want to modify.object{}
colPropsAn object containing Col props to specify columns, offset etc. See moreobject{ xs: 24, sm: 12, md: 8 }
<hr />

RequireNewPasswordForm

<RequireNewPasswordForm />
PropertyDescriptionTypeDefault
passwordInputPropspassword input field propsobject{ prefix: <Icon type="lock" />, size: 'large', placeholder: 'New Password', message: 'Please enter your new password!'}
buttonPropsSubmit button propsobject{ size: 'large', type: 'primary', label: 'Submit'}
<hr />