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

@alexseitsinger/helpful-components

v0.2.0

Published

A collection of helpful components for website building.

Downloads

30

Readme

Helpful Components

Description

A collection of helpful components to aid in website building.

Installation

npm install @alexseitsinger/helpful-components

or

yarn add @alexseitsinger/helpful-components

Components

Center Box

A container that is vertically and horizontally centered in it's parent.

Props
  • children - (Node(s), Required) - The element(s) to insert into this one.

Center Column

A container that is horizontally centered with fluid width and height of it's parent.

Props
  • children - (Node(s), Required) - The element(s) to insert into this one.

Editable Textarea

A textarea that contains a submit and cancel button.

Props
  • defaultValue - (String, Optional) - The value to insert into the textarea before any other input gets entered.
  • submitButtonStyle - (Object, Optional) - The style to apply to the submit button.
  • onClickSubmitButton - (Function, Required) - The function to invoke when the submit button is clicked. Will be passed the value of the textarea.
  • cancelButtonStyle - (Object, Optional) - The style to apply to the cancel button.
  • onClickCancelButton - (Function, Required) - The function to invoke when the cancel button is clicked.

Fixed Top Header

A container thats fixed to the top, and spans the entire width. Will still provide its height to the sibling elements when positioning.

Props
  • children - (Node, Required) - The element(s) to insert inside this one.
  • size - (Number/String, Required) - The height of the header.
  • zIndex - (Number, Optional) - The zIndex to use for layering.

Fluid Width Container

A container that fills the width of its parent, fills the height of the parent, and applies padding.

Props
  • children - (Node, Required) - The element(s) to insert inside this container.
  • padding - (Number/String, Optional) - The amount of padding to use on the left and right sides.
  • align - (Boolean, Optional) - Center the content in the container.
  • stretchChild - (Boolean, Optional) - Force the child element to fill the width of the container.
  • containerClassName - (String, Optional) - The classname to use on the container element.

Form Field Error

An error message that can appear on the left, right, top, bottom, or center of another input field. Must be contains within a relative positioned parent.

Props
  • isVisible - (Boolean, Required) - Determines if the error is displayed or not.
  • message - (String, Required) - The message to display when the error is visible.
  • position - (String, Required) - The position, relative to the parent container, that the error will take when visible.
  • textStyle - (Object, Optional) - The style to apply to the text of the error.
  • bodyStyle - (Object, Optional) - The style to apply to the body of the error.
  • onClick - (Function, Optional) - The function to invoke when the error is clicked.

Google Analytics

Automatically emits a pageview beacon on location change. Connects to an event emitter to listen for other analytics events to emit a beacon.

Props
  • location - (Object, Required) - The current page location object from react-router.
  • environmentName - (String, Required) - The name of the current environment. Will only emit beacons in production.
  • id - (String, Required) - The google analytics tracker id.
  • emitter - (Object, Required) - The event emitter to add/remove listeners to for other analytics events.
    • GOOGLE_ANALYTICS_PAGE_VIEW
    • GOOGLE_ANALYTICS_MODAL_VIEW
    • GOOGLE_ANALYTICS_EVENT
    • GOOGLE_ANALYTICS_TIMING

Loading Screen

A simple element that is layerd above the rest, and displays a spinner.

Props
  • icon - (Object, Optional) - The FontAwesome icon to display.
  • iconSize - (String/Number, Optional) - The size of the icon to display.
  • backgroundColor - (String, Optional) - The background color to use.
  • zIndex - (Number, Optional) - The layer to use with the loading screen.

Localized Date String

A component that converts a UTC timestamp string into a localized date string.

Props
  • date - (String, Required) - The timestamp string to convert.

Localized Time String

A component that converts a UTC timestamp string into a localized time string.

Props
  • time - (String, Required) - The timestamp string to convert.

Overlay

A component that renders an overlay of elements on mouseenter and removes the overlay onmouseleave.

Props
  • children - (Node(s), Required) - The children to render underneath the overlay.
  • renderOverlay - (Function, Required) - The method to invoke to render the overlay.
  • containerClassname - (String, Optional) - The classname to use on the overlay container element. Useful for finding element in tests.

Responsive Footer Container

A component that toggles the last element between relative and absolute positioning relative to its sibling element.

Props
  • children - (Node(s) / Required) - The element(s) to render within the container.

Responsive Width Container

A container that adjusts to a fixed width less than its breakpoint.

Props
  • children - (Node(s), Required) - The element(s) to insert inside this one.
  • align - (Boolean, Optional) - Force the sibling elements to be centered, and fill the width of this container.

requireAnonymous (HOC)

Arguments
  • Component - (Node, Required) - The component to render if isAuthenticated is false.
  • path - (String, Required) - The path to navigate to, using redux, if isAuthenticated is true.

requireAuthenticated (HOC)

Arguments
  • Component - (Node, Required) - The component to render if isAuthenticated is true.
  • path - (String, Required) - The path to navigate to, using redux, if isAuthenticated is false.

toggledComponent (HOC)

Arguments
  • AuthenticatedComponent - (Node, Required) - The component to render if isAuthenticated is True.
  • AnonymousComponent - (Node, Required) - The component to render if isAuthenticated is false.