npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-elements-lib

v0.0.9

Published

**React Elements Lib** is a customizable React component library built with Tailwind CSS, offering a range of commonly used UI components such as Header, Footer, Spinner, Toast notifications, Date Picker, and more. It’s designed to help developers create

Downloads

490

Readme

React Elements Lib

React Elements Lib is a customizable React component library built with Tailwind CSS, offering a range of commonly used UI components such as Header, Footer, Spinner, Toast notifications, Date Picker, and more. It’s designed to help developers create beautiful, consistent UIs quickly and efficiently.

Table of Contents


Installation

To install React Elements Lib, use npm:

npm install react-elements-lib

You also need to install Tailwind CSS in your project if you haven’t already:

npm install tailwindcss
npx tailwindcss init

Then, add the following to your Tailwind CSS configuration in tailwind.config.js:

module.exports = {
  theme: {
    extend: {
      colors: {
        "nexcade-blue": "#1E3A8A",
        "nexcade-green": "#00BFA6",
        "nexcade-red": "#FF5A5F",
        "nexcade-yellow": "#FFC72C",
        "nexcade-gray": "#F5F5F5",
      },
    },
  },
  variants: {},
  plugins: [],
};

Getting Started

Import the components you need from react-elements-lib and start using them in your project. Each component is designed to be customizable with props.

import { Header, Footer, Spinner, ToastContainer } from "react-elements-lib";

function App() {
  return (
    <div>
      <Header />
      <Spinner size="md" color="text-blue-500" />
      <ToastContainer position="top-right" />
      <Footer />
    </div>
  );
}

Components

Header

The Header component includes a logo, navigation links, and an optional button.

import { Header } from "react-elements-lib";

const navLinks = [
  { label: "Home", href: "/" },
  { label: "Components", href: "/components" },
  { label: "Docs", href: "/docs" },
];

<Header
  logoSrc="/logo.png"
  links={navLinks}
  buttonLabel="Sign Up"
  onButtonClick={() => alert("Button clicked!")}
/>;

Props

| Prop | Type | Description | | --------------- | -------- | --------------------------------------------------------------------------- | | logoSrc | string | The path to the logo image | | links | array | An array of objects with label and href properties for each navigation link | | buttonLabel | string | The label for the optional button | | onButtonClick | function | The function to call when the button is clicked |

Footer

The Footer component includes navigation links, social media icons, and copyright information.

Usage

import { Footer } from "react-elements-lib";

const socialLinks = [
  { label: "Facebook", href: "https://facebook.com", icon: <FiFacebook /> },
  { label: "Twitter", href: "https://twitter.com", icon: <FiTwitter /> },
];

<Footer
  links={navLinks}
  socialLinks={socialLinks}
  copyright="© 2024 MyLibrary"
/>;

Props

| Prop | Type | Description | | ------------- | ------ | ------------------------------------------------------------------------------------ | | links | array | An array of objects with label and href properties for each navigation link | | socialLinks | array | An array of objects with label, href, and icon properties for each social media link | | copyright | string | The copyright information |

Spinner

The Spinner component displays a loading spinner with customizable size and color.

Usage

import { Spinner } from "react-elements-lib";

<Spinner size="lg" color="text-blue-500" />;

Props

| Prop | Type | Description | | ------- | ------ | ------------------------------------ | | size | string | The size of the spinner (sm, md, lg) | | color | string | The color of the spinner |

Toast

The ToastContainer component manages temporary notifications that appear and disappear automatically.

Usage

import { ToastContainer } from "react-elements-lib";

<ToastContainer position="top-right" />;

Props

| Prop | Type | Description | | ---------- | ------ | ------------------------------------------------------------------------------------ | | position | string | The position of the toast container (top-left, top-right, bottom-left, bottom-right) |

Date Picker

The DatePicker component supports single and range date selection.

Usage

import { DatePicker } from "react-elements-lib";

<DatePicker isRange={false} onSelect={(date) => console.log(date)} />;

Props

| Prop | Type | Description | | ---------- | -------- | -------------------------------------------- | | isRange | boolean | Whether to enable range selection | | onSelect | function | The function to call when a date is selected |

Contributing

Contributions are welcome! Please open an issue or submit a pull request with your improvements or bug fixes.

License

This project is licensed under the MIT License.

This README gives an overview of React Elements Lib, covering installation, component usage, props, and example code snippets to help users get started. Feel free to modify and expand it as your component library grows.