React components library
npm install cos-fec-libraryThis React component library is aimed at developers to spend less time writing code and more time building a fantastic User experience.
Install cos-fec-library with npm
``bash`
npm install cos-fec-library
The most basic use of the Login component:
`javascript
import { Login } from "cos-fec-library/dist/components/Login";
import "cos-fec-library/dist/index.css";
function App() {
return (
userNameType="email"
loginBtnLabel="Sigin"
onSubmit={onSubmitFunction}
usernamePlaceholder="Enter Username"
passwordPlaceholder="Enter Password"
/>
);
}
`
| Props | Description | Default |
| ------------------- | :-----------------: | --------------: |
| formTitle | string | "Login Form" |
| userNameLabel | string | "User Name" |
| userNameType | "string" or "email" | "string" |
| emailError | string | "Invalid Email" |
| loginBtnLabel | string | "Login" |
| onSubmit | Required. func | - |
| usernamePlaceholder | string | - |
| passwordPlaceholder | string | - |
You can also pass child components such as GoogleLogin or LinkedInLogin into the Login component.
`javascript
import { Login } from "cos-fec-library/dist/components/Login";
import "cos-fec-library/dist/index.css";
import GoogleLogin from "react-google-login";
function App() {
clientId={clientId}
onFailure={onFailureCallback}
onSuccess={onSuccessCallback}
cookiePolicy={"single_host_origin"}
/>
}
``
For more details see the Login Story