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

@spectrum-web-components/link

v0.42.2

Published

An `<sp-link>` allow users to navigate to a different location. They can be presented in-line inside a paragraph or as a standalone text.

Downloads

6,690

Readme

Description

An <sp-link> allow users to navigate to a different location. They can be presented in-line inside a paragraph or as a standalone text.

Usage

See it on NPM! How big is this package in your project? Try it on webcomponents.dev

yarn add @spectrum-web-components/link

Import the side effectful registration of <sp-link> via:

import '@spectrum-web-components/link/sp-link.js';

When looking to leverage the Link base class as a type and/or for extension purposes, do so via:

import { Link } from '@spectrum-web-components/link';

Example

This is an <sp-link href="#">example link</sp-link>.

Variants

Standard links

Standard links are blue and should be used to call attention to the link or for when the blue color won’t feel too overwhelming in the experience.

This is a <sp-link href="#">standard link</sp-link>.

Secondary links

The secondary variant is the same color as the paragraph text inline of which it appears. Its subdued appearance is optimal for when the primary variant is too overwhelming, such as in blocks of text with several references linked throughout.

This is a <sp-link href="#" variant="secondary">secondary link</sp-link>.

Static colored links

When a link needs to be placed on top of a colored background or a visual it may be appropriate to ship it with a static color, regardless of the theme settings with which it is delivered. Leverage the static attribute with its white or black values to ensure the delivery is the same in all contexts.

<div
    style="background-color: #0f797d; padding: 15px 20px; display: inline-block;"
>
    <p style="color: rgb(240, 240, 240);">
        This
        <sp-link static="white" href="#">link</sp-link>
        is over a background.
    </p>
</div>
<div
    style="background-color: rgb(181, 209, 211); padding: 15px 20px; display: inline-block;"
>
    <p style="color: rgb(15, 15, 15);">
        This
        <sp-link static="black" href="#">link</sp-link>
        is over a background.
    </p>
</div>

Quiet links

All links can have a quiet style, which means they don’t have an underline. This style should only be used when the placement and context of the link is explicit enough that a visible underline isn’t necessary. Quiet links are less accessible, so they should not be used for links that are essential to the experience. These are commonly used in website footers, where there are several lists of links that are shortcuts to other pages.

<p>This is a <sp-link quiet href="#">quiet standard link</sp-link>.</p>
<p>This is a <sp-link quiet variant="secondary" href="#">quiet secondary link</sp-link>.</p>
<div
    style="background-color: #0f797d; padding: 15px 20px; display: inline-block;"
>
    <p style="color: rgb(240, 240, 240);">
        This is a
        <sp-link static="white" quiet href="#">quiet link</sp-link>
        over a background.
    </p>
</div>

Download attribute

The download attribute on an <a> tag prompts a user to download a link as opposed to navigating to it. This attribute has been carried forward to <sp-link> to function the same.

While it functions this way without assigning a value, actually assigning the value allows custom naming of the download link in accordance with standard <a> rules defined by the browser.

This is a <sp-link download="myfile.txt" href="#">download link</sp-link>.