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

@illinois-toolkit/ilw-hero

v1.0.0

Published

Illinois Toolkit: The Hero Image component adds a large picture at the top of the page.

Downloads

254

Readme

Sample README

Overview

Hero component for the web toolkit. The Hero Image component adds a large picture at the top of the page. It is used to draw attention to the page and can be used to set the tone for the page.

There is one slot, called "background", used for the background item. This is optional, but is most likely an image.

The default text should include a header (h1, h2, h3) and possibly a button list. The buttons will need to be styled separately.

Attributes include:

  • theme: the theme/background of the content. Options are blue, orange, gray, blue-gradient, orange-gradient
  • width: whether or not this is contained in the parent (default) or if it will expand to full width (full). Auto will not work in this case.
  • align: whether or not the text is vertical or horizonally aligned (top-left, left-center, right-bottom, etc.)
  • focus: if the image has a focal point if it shrinks or not. Values are top, bottom, left, right. Default is center.
  • shadow: if the text should have a drop shadow on it.
  • collapse: if the image should disappear in mobile view (useful if the image is just a blank pattern or does not give relevant information)
  • alwayson: if the text should always appear over the image in mobile view (useful if the image is just a blank pattern or does not give relevant information and there will always be sufficient color contrast between the text and image)

Contact Team

[email protected]

NPM Install

None yet, still in alpha.

Files

None yet, still in alpha.

Code Examples

<ilw-hero align="left" focus="bottom" shadow theme="white">
  <img src="https://picsum.photos/1920/1280" alt="" slot="background">
  <h1>Innovating solutions every year</h1>
  <ul class="ilw-buttons">
      <li>
          <a href="#">Link 1</a>
      </li>
      <li>
          <a href="#">Link 2</a>
      </li>
      <li>
          <a href="#">Link 3</a>
      </li>
  </ul>
</ilw-hero>
<ilw-hero collapse="true">
  <h2>Innovating solutions every year</h2>
  <ul class="ilw-buttons">
      <li>
          <a href="#">Link 1</a>
      </li>
      <li>
          <a href="#">Link 2</a>
      </li>
      <li>
          <a href="#">Link 3</a>
      </li>
  </ul>
</ilw-hero>
 <ilw-hero>
  <video slot="background" autoplay="" loop="" muted="" poster="https://cdn-e.education.illinois.edu/video/first_image.png"><source src="https://cdn-e.education.illinois.edu/video/homepage8.mp4" type="video/mp4">Your browser does not support the video tag.
  </video>
  <h2>Innovating solutions every year</h2>
  <ul class="ilw-buttons">
    <li>
        <a href="#">Link 1</a>
    </li>
    <li>
        <a href="#">Link 2</a>
    </li>
    <li>
        <a href="#">Link 3</a>
    </li>
  </ul>
</ilw-hero>

Accessibility Notes and Use

The obvious one is color contrast. Make sure you have an image that text can overlay on. Match the theme with the dominant color of the image (so if you have a white image, use the white theme, if you have a dark image, use the blue theme). Make sure you test using multiple screen sizes, as the image will shift based on the size of the screen. If you need assistance, you can use the shadow option to put a shadow in front of the heading text.

For a graphic, make sure you choose a graphic that would reasonably display on a monitor. Do not choose a portrait image, or it will be cropped oddly.

You can include buttons using the ilw-buttons class or ilw-button class.

External references

https://usability.yale.edu/usability-best-practices/hero-imagescarousels