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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-main-hero

v0.24.0

Published

A react component for hero block

Downloads

25

Readme

react-main-hero

It's a functional React component. It is designed to easy add a hero block to your site.

react main hero

Content:

Description

Install

Usage

Interactive demo

Description

The component creates a kind of block hero out of images. In the standard use case you will need 6 images: left and right background, left and right parallax and left and right front image. But you can exclude some images to customize the component as you need. You can also pass some options as an argument to the component. See below for more details.

Before publication, the component is tested using automated tests. But bugs may occur. Please report all bugs in the GitHub issues section.

Install

npm:


npm i react-main-hero

yarn:


yarn add react-main-hero

Usage

For express usage, after installation, add the code to the module in which you want to use the component:

import { MainHero } from "react-main-hero";

/* You have to change the paths to the images or use their URIs*/
const images = {
  srcBackLeft: "./back-left.png",
  srcBackRight: "./back-right.png",
  srcParallaxLeft: "./parallax-left.png",
  srcParallaxRight: "./parallax-right.png",
  srcFrontLeft: "./front-left.png",
  srcFrontRight: "./front-right.png",
};

export default function App() {
    return (
        //Components above hero block 
        <MainHero images={images} />
        //Components below hero block
    );

}

You can also define some component options and CSS class name (if required):

import { MainHero } from "react-main-hero";

/* You have to change the paths to the images or use their URIs*/
const images = {
  srcBackLeft: "./back-left.png",
  srcBackRight: "./back-right.png",
  srcParallaxLeft: "./parallax-left.png",
  srcParallaxRight: "./parallax-right.png",
  srcFrontLeft: "./front-left.png",
  srcFrontRight: "./front-right.png",
};

/*The option values shown are their default values*/
const options = {
  maxHeight: 600, //Max height of hero block in pixels
  aspectRatio: 900 / 600, //The ratio of width to height of the hero block
  offsetFrontRatio: 1 / 5, //Ratio of front images offset to mouse offset relative to the center
  offsetParallaxRatio: 1 / 20, //Ratio of parallax images offset to mouse offset relative to the center
  effectParallaxShift: 10, //Minimum shift of the mouse relative to the center at which parallax starts to move
  startBackOpacity: 0.1, //Initial background images opacity
  centerOffsetPercent: 0, //Image center offset coefficient (can be negative) in percent. For adjusting the center of front images.
};

export default function App() {
    return (
        //Components above hero block 
        <MainHero className="hero" images={images} options={options}/>
        //Components below hero block
    );

}

The examples above uses source files with a resolution of 900 by 600 pixels. You can download a sample of these files, including the source file in Photoshop / GIMP format (for export images) in the archive.

Interactive demo

An interactive demonstration is available on my personal website🔥.

You can also play with the component in the codesandbox🔥.

Best regards, Anatoliy Aptukov.