Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-500

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-500

A react component for internal server errors

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React 500

HitCount

https://nodei.co/npm/react-500.png?downloads=true&downloadRank=true&stars=true

React 500 is a customizeable common react component for internal server errors.

Installation

npm install react-500

Usage

import React from 'react';
import Error from "react-500";

export default function App(){
    return(
        <Error />
    )
}

Main

API

Following are the props which can be passed to customize the behaviour

PropType
oopsStyleJavascript Object
messageStyleJavascript Object
buttonJsx Element

Customization

customize the text as follows


export default function App(){
    const OopsStyle = {
        fontSize: "6rem",
        display: "block",
        fontFamily: "sans-serif",
        letterSpacing: "10px",
        color: "#b5d5ff",
        fontStyle: "italic"
    }
    const messageStyle={
        fontSize: "1.2rem",
        textAlign:"center",
        fontWeight: "400",
        fontFamily: "roboto",
        letterSpacing: "0.7rem",
        color: "pink",
        display: "block",

    }
    return(
        <Error 
            oopsStyle={OopsStyle} 
            messageStyle={messageStyle} 
        />
    )
}

Main

any custom jsx component can be added in place on the homepage button


const ButtonStyle = {
    backgroundColor: "#2424e8a8",
    color: "white",
    padding: "10px 25px",
    borderRadius: "20px",
    marginLeft: "8.5rem",
    marginTop: "2rem",
    border: 0,
}
const Button = ()=>{
    return(
        <button style={ButtonStyle} onClick={()=>alert(1)}>
            Back Button
        </button>
    )
}
export default function App(){
    return(
        <Error button={Button}/>
    )
}

Main

Keywords

FAQs

Package last updated on 05 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc