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

@springernature/springer-listing

v7.0.0

Published

Display of scannable content typically within a list

Downloads

41

Readme

Springer listing

Display of scannable content typically within a non-curated list, for example, entries in a search results list.

Optional image shrinks besides the title and text as the viewport becomes smaller.

Usage

Usage

Import the Sass:

@import '../node_modules/@springernature/springer-listing/scss/10-settings/listing';
@import '../node_modules/@springernature/springer-listing/scss/50-components/listing';

Then compile the template located in the ./view folder whenever the component is needed. See the ./demo/context.json to see examples of the expected data. Note that the listings themselves are supplied as an array on the listings property. This allows for applying various options (like level in the below example) to every listing.

{
    "level": "4",
    "listings": [
            ...
        ]
    }
}

Variants

Level

Depending on the level of the heading that introduces the listings section, the heading level of each listing’s title might need to be changed. For example, if the introductory heading for the listings section is an <h3>, the level should be "4":

{
    "level": "4",
    "listings": [
            ...
        ]
    }
}

The heading level is changed for screen readers only, using aria-level. The title/heading’s style (font size) remains unaffected.

Authors

Authors of the listed publication can be supplied as an array. Comma separation is handled automatically.

{
    "permalink": "/path/to/permalink",
	"title": "Excellent cyclic performance of electrolytic MnO2 in Li/MnO2 rechargeable batteries",
    "authors": [
        "Zhen Cao",
        "Qizhen Xiao",
        "Gangtie Lie",
        "Zhaohui Li"
    ]
    ...
}

Metadata

Metadata is supplied via the meta property. This constitutes an array of simple strings.

{
    "permalink": "/path/to/permalink",
	"title": "Excellent cyclic performance of electrolytic MnO2 in Li/MnO2 rechargeable batteries",
    "meta": [
        "Original Paper",
        "4 October 2019"
    ]
    ...
}

Options

Options constitute different ways to consume the content. Each option is an object with label and url properties. The optionIcon property is the path for the (chevron) icon for each option. This is placed on the parent context.

{
    "optionIcon": "path/to/option/ion#icon-id",
    "listings": {
        "permalink": "/path/to/permalink",
        "title": "Excellent cyclic performance of electrolytic MnO2 in Li/MnO2 rechargeable batteries",
        "options": [
            {
                "label": "Full text",
                "url": "/path/to/full/text"
            },
            {
                "label": "PDF",
                "url": "/path/to/pdf"
            }
            ...
        ]
    }
}

Intro text

The component supports teaser text using the content property, truncated with the -webkit-line-clamp property. This is set to two lines by default but can be adjusted with the lines property (String).

"lines": "3"

Omitting the property turns line-clamping off. The full text is displayed instead.