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

ui-redpanda

v0.2.9

Published

Visit [Red Panda Studio](https://red-panda.studio/redpandaui) for visual examples.

Downloads

249

Readme

Visit Red Panda Studio for visual examples.

GitHub

  1. Clone the project down.
git clone https://github.com/TimothyRedPanda/redpanda-ui.git
  1. Move into the correct directory.
cd ./redpanda-ui
  1. Install the dependencies and build the project.
npm install
  1. Run Storybook to view full UI components documentation.
npm run storybook

Getting Started

  1. Install Red Panda UI into your React project.
npm i ui-redpanda@latest
  1. Import your desired component and the styles.
import { Button /* Or the component of your choice */ } from 'ui-redpanda';
import "ui-redpanda/dist/style.css";
  1. Use the component.
import { Button, Switch, Label, Input, Textbox } from "ui-redpanda";
import "ui-redpanda/dist/style.css";

const App = () => {
  return (
    <div>
      <Button>Default</Button>
      <Switch />
      <Label label="Your label here"/>
      <Input type="text" sanitized/>
      <Textbox name="Your text box" placeholder="Type here..." />
    </div>
  );
};

export default App;

Components

Each component has a className prop if you wish to add your own class. Just to allow you to reference it in CSS if you wish. Remember though any styles you apply in CSS will have to have the !important tag.


.yourClass {
  /* !important is needed to override the default styles. */
  background-color: #fff !important;
}

Button

Props

The Button component accepts the following props:

  • children (ReactNode, required): The content to be displayed inside the button.

  • onClick (function, optional): The function to be called when the button is clicked.

  • variant (string, optional): The style variant, can be contained, outlined or disabled.

  • size (string, optional): Size of the button, can be small, base(default size) or large.

Switch

Props

The Switch component accepts the following props:

  • onClick (function, optional): The function to be called when the switch is toggled.

  • variant (string, optional): The style variant, can be live or disabled.

Label

Props

The Label component accepts the following props:

  • label (string, required): The actual text the label says.

  • size (string, optional): Text size, can be small, base(default size) or large.

Input

Props

The Input component accepts the following props:

  • type (string, required): The type of the input, e.g., text, checkbox, radio, number or date.

  • defaultValue (string, optional): The default value of the input.

  • className (string, optional): Additional class names for styling the input.

  • onChange (function, optional): The function to be called when the input value changes.

  • onClick (function, optional): The function to be called when the input is clicked.

  • sanitized (boolean, optional): If you simply - <Input sanitized/>. Then any text input will be sanitized. If you wish to do your own sanitization then simply leave this off.

Textbox

Props

The Textbox component accepts the following props:

  • rows (number, optional): The number of rows for the textarea. Default is 4.
  • cols (number, optional): The number of columns for the textarea. Default is 50.
  • name (string, optional): The name attribute of the textarea. Default is "textbox".
  • className (string, optional): Additional class names for styling the textarea.
  • onChange (function, optional): The function to be called when the textarea value changes.
  • sanitized (boolean, optional): If set to true, the input will be sanitized to prevent special characters, HTML, and other potentially dangerous inputs.
  • placeholder (string, optional): The placeholder text for the textarea. Default is "Text area...".

Sanitization

Can be toggled on Textbox and Input components -

  • Escape special characters.
  • HTML tags.
  • Script tags.
  • Event handlers.
  • CSS expressions.