README
@comparaonline/ui-offer-errors
A package for render view errors
Getting Started
To getting started with this package you will first install it, so
yarn add @comparaonline/ui-offer-errors
or
npm install @comparaonline/ui-offer-errors
Usage
Once you have installed the package, you can star using like
import React, { Component } from 'react';
import { Error404 } from '@comparaonline/ui-offer-errors';
interface ErrorViewProps extends RouteComponentProps<any> {}
class ErrorView extends Component<ErrorViewProps> {
render() {
return (
<Error404
buttonLabel={'Ir al inicio'}
title={'Titulo'}
subtitle={'Sub titulo'}
description={'Mi descripciĆ³n'}
onClick={() => history.push('/form')}
/>
);
}
}
As you can see is so simple to use it
Props
the props that our component will use
Prop Name | Description | Default Value | Expected Type Value | Required |
---|---|---|---|---|
buttonProps | an object containing the props needed for Button material ui | {} | ButtonProps | false |
buttonLabel | the button title | '' | string | false |
title | the title for the error view | '' | string | false |
subtitle | the subtitle for the error view | '' | string | false |
description | the description for the error view | '' | string | false |
descriptionComponent | a component that will replace the entire description section | undefined | ReactElement | false |
onClick | a function to be invoked when hit the button into the error view | () => undefined | Function | false |
Happy Coding :sunglasses: