@silkyland/react-nerd-helpers
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-beta • Public • Published

React Nerd Helpers

React Nerd Helpers is a React-based library that provides a set of common UI helpers such as loading and error handling for your applications.

Installation

You can install the React Nerd Helpers library via npm:

npm install @silkyland/react-nerd-helpers

or yarn:

yarn add @silkyland/react-nerd-helpers

Components

The library currently includes the following components:

  • NerdLoading: A loading spinner component.
  • NerdError: An error display component.

Usage

Below are examples of how to use the NerdLoading and NerdError components.

NerdLoading

import { NerdLoading } from '@silkyland/react-nerd-helpers'

function App() {
  const [isLoading, setIsLoading] = React.useState(true)

  return (
    <div>
      <NerdLoading visible={isLoading} message="Loading, please wait..." />
      {/* Your application code */}
    </div>
  )
}

NerdError

import { NerdError } from '@silkyland/react-nerd-helpers'

function App() {
  const [error, setError] = React.useState(null)

  return (
    <div>
      {error && (
        <NerdError
          error={error}
          onDismissed={() => setError(null)}
          title="Oops, something went wrong!"
        />
      )}
      {/* Your application code */}
    </div>
  )
}

Contributing

If you have any suggestions or find any bugs, please file an issue on the GitHub page.

Github Repository

License

React Nerd Helpers is released under the MIT License.

Readme

Keywords

Package Sidebar

Install

npm i @silkyland/react-nerd-helpers

Weekly Downloads

1

Version

0.1.0-beta

License

MIT

Unpacked Size

11.9 kB

Total Files

10

Last publish

Collaborators

  • silkyland