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

ourlit-components

v1.0.1

Published

## Components at a glance: - OurlitButton - OurlitTitle, OurlitSubtitle, OurlitHeader, and OurlitText - OurlitModal - OurlitIcon - VerticalStack, HorizontalStack - OurlitTextInput, OurlitMessageInput - OurlitImageContainer

Downloads

5

Readme

Ourlit's Component Library

Components at a glance:

  • OurlitButton
  • OurlitTitle, OurlitSubtitle, OurlitHeader, and OurlitText
  • OurlitModal
  • OurlitIcon
  • VerticalStack, HorizontalStack
  • OurlitTextInput, OurlitMessageInput
  • OurlitImageContainer

Buttons

OurlitButton is a basic button component with the following customization options as props:

  • text: The text you want displayed in the button
  • color (optional): 'primaryBlue' or 'primaryRed' [default 'primaryRed']
  • size (optional): 'small', 'medium', or 'large' [default 'medium']
  • variant (optional): 'text', 'contained', or 'outlined' [default 'contained']
  • onClick (optional): callback of type () => void

Example:

const MyButton = <OurlitButton text="A Button" onClick={() => console.log('Clicked')} />

Text

Text options are listed in "components at a glance." The typography props are text and color (optional). The color options are 'primaryBlue', 'primaryRed', 'black', 'white'.

Example:

const MyTitle = <OurlitTitle text="Title" color="white" />

Modal

Modal component for displaying a modal on the screen. Consists of a button and popup content. The props are exactly the same as those of the OurlitButton except modalSize (optional) which takes 'small', 'medium', and 'large' content which takes a React element with the content you want contained in the modal.

Example:

const MyModal = <OurlitModal text="Open Modal" size="small" modalSize="large" content={<OurlitTitle text="The modal content">} />

Icons

Icon component letting you easily include common icons in the site. This is the type declaration for the props:

export type OurlitIconProps = {
    size?: 'small' | 'medium' | 'large' | string;
    type: (
        'home' | 'menu' | 'search' | 'account' | 'settings' | 'add' |
        'edit' | 'delete' | 'check' | 'close' | 'refresh' | 'star' | 
        'notifications' | 'send'
    );
};

You can use any of the strings included to define which icon you want displayed. The size prop takes the predefined sizes, or you can give is a font size as a string (i.e. "24", "32", etc.)

Stacks for easy layout

VerticalStack and HorizontalStack. Use these as positional elements as containers for contents that already have flexbox-type positioning done for you. Further, you can edit any of the following props as well:

export type StackProps = {
    spacing?: number;
    justifyContent?: 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
    alignItems?: 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline';
    divider?: boolean;
    style?: React.CSSProperties;
    children: React.ReactElement | React.ReactElement[];
};

Text input

This includes OurlitTextInput and OurlitMessageInput. They're very similar components, except the message input component is formatted more like a traditional message view. Here are the type props for it:

export type TextInputProps = {
    label?: string;
    value?: string;
    variant?: 'standard' | 'filled' | 'outlined';
    onChange?: (event: string) => void;
    style?: React.CSSProperties;
    rows?: number;
    error?: boolean;
    helperText?: string;
    multiline?: boolean;
};

These apply to both components.

Image container

This is the OurlitImageContainer component. This is intended to be a convenient container for images. For example, this could be used to diplay the cover photo of a book. Here are its props:

export type ImageContainerProps = {
    src: string;
    alt?: string;
    width?: string;
    height?: string;
    borderRadius?: string;
};