0.1.7 • Published 7 months ago

react-notfound-page v0.1.7

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

NotFound Component

The NotFound component is a React functional component that displays a 404 Not Found message along with an animation and an optional button.

A description of the GIF

Installation

npm i react-notfound-page

Props

The NotFound component accepts the following props:

PropTypeDefault ValueDescription
ButtonComponentReact.FC (optional)() => nullA custom button component to render.
textstring (optional)'404 NotFound !'The text to display in the Not Found message.
rootClassNamestring (optional)''Additional class names for the root container.
textClassNamestring (optional)''Additional class names for the text element.

Example Usage

Below is an example of how to use the NotFound component in your application:

import React from 'react';
import NotFound from 'react-notfound-page';

const CustomButton = () => (
  <button className="btn btn-primary">Go Back</button>
);

const AppNotFoundPage = () => {
  return (
    <div>
      <NotFound 
        ButtonComponent={CustomButton} 
        text="Page Not Found" 
        textClassName="text-red-500" 
        rootClassName="my-custom-class" 
      />
    </div>
  );
};

export default AppNotFoundPage;

License

This component is open source and available under the MIT License.

0.1.7

7 months ago

0.1.5

7 months ago

0.1.4

7 months ago

0.1.3

7 months ago