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

my-ui-library1

v1.10.1

Published

my-ui-library1 ==============

Downloads

24

Readme

my-ui-library1

my-ui-library1 is a React UI component library that provides reusable components such as Button, Card, Input, and Modal. These components simplify the creation of common UI elements in your React applications.

=================================================================================================================================================================================================================================

Installation

To install the library, run:

bash

Copy code

npm install my-ui-library1

====================================================================================

Components

This library includes the following components:


===========================================================================================================================================

1. Button

A customizable button component that accepts a label, click handler, and button type.

=========================================================================================

Usage

javascript

import React from 'react';
import Button from 'my-ui-library1';

const App = () => {
  return (
    <Button 
      label="Click Me" 
      onClick={() => alert('Button clicked!')} 
    />
  );
};

export default App;

===========================================================================================================================================================================================================================================================

Props

Prop

Type

Description

Default

label

string

The text to display inside the button

-

onClick

function

Callback function when the button is clicked

-

type

string

The button type (e.g., button, submit)

button


==========================================================================================================================================================================================================================================================

2. Card

A simple card component that acts as a container for any content passed as children.

========================================================================================

Usage

javascript

Copy code

import React from 'react';
import Card from 'my-ui-library1';

const App = () => {
  return (
    <Card>
      <h2>Card Title</h2>
      <p>This is some content inside the card.</p>
    </Card>
  );
};

export default App;

================================================================================================================================================================================================================================================================

Props

Prop

Type

Description

Default

children

ReactNode

The content to be displayed inside the card

-


=====================================================================================================================

3. Input

A simple input component for user text input with an onChange handler for capturing input values.

=======================================================================================================

Usage

javascript

import React, { useState } from 'react';
import Input from 'my-ui-library1';

const App = () => {
  const [value, setValue] = useState('');

  return (
    <Input 
      placeholder="Enter text..." 
      onChange={(e) => setValue(e.target.value)} 
    />
  );
};

export default App;

==============================================================================================================================================================================================================================================================================================================================

Props

Prop

Type

Description

Default

placeholder

string

Placeholder text for the input

-

onChange

function

Function called when the input value changes

-


==================================================================================================================================================================================

4. Modal

A modal component that displays content in an overlay and can be closed via a close handler.

================================================================================================

Usage

javascript

import React, { useState } from 'react';
import Modal from 'my-ui-library1';

const App = () => {
  const [isOpen, setIsOpen] = useState(false);

  return (
    <div>
      <button onClick={() => setIsOpen(true)}>Open Modal</button>
      <Modal isOpen={isOpen} onClose={() => setIsOpen(false)}>
        <h2>Modal Title</h2>
        <p>This is modal content.</p>
      </Modal>
    </div>
  );
};

export default App;

===================================================================================================================================================================================================================================================================================================================================================================================================================================================================

Props

Prop

Type

Description

Default

isOpen

boolean

Controls whether the modal is visible

-

onClose

function

Function to call when modal is closed

-

children

ReactNode

Content to display inside the modal

-


===============================================================================================================================================================================================================================================

CSS

Each component comes with basic CSS for default styling. You can override these styles by using the following CSS class names:

  • Button: .my-button
  • Card: .my-card
  • Input: .my-input
  • Modal: .my-modal, .modal-content, .close

If needed, you can customize the styles by adding your own CSS rules to target these classes.


=================================================================================================================================================================================================================================================================================================================================================================================

License

This project is licensed under the ISC License.

===================================================