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

@gemeente-denhaag/anchor-navigation

v0.1.1-alpha.265

Published

An anchor navigation component

Downloads

609

Readme

Anchor navigation

The anchor navigation shows which subjects there are on the page and how far you are.

When to use

Anchor navigations need to be used on longer pages with multiple sub-headings. The navigation gives the user a good overview of the content of a page.

Alternatives and related components

Use form navigation to show the user’s progress through a set of steps in a form

Anatomy

The anchor navigation consists of:

  1. Line: this line shows the state of a chapter
  2. Label: describes the information of a chapter
  3. Progress line (on mobile): this line shows how far you are on a page
  4. Container

(Interactive) states

The anchor navigation the states inactive, active, hover and focus.

Design properties

Typography

  • Label inactive: TheSans/md/400
  • Label active: TheSans/md/700

Color

  • Label inactive: text color Grey/4
  • Label active: text color Blue/3
  • Line inactive: fill color Grey/2
  • Line active: fill color Blue/3

Specific for mobile

  • Progress line: fill color Blue/3
  • Shadow: fill color 10% of Grey/4, border-top color Grey/3

Interactive states

  • Hover inactive: label color Blue/3
  • Focus: border color Ocher/5

Structure

  • Label: padding-top and padding bottom 8px, padding-right 16px
  • Line: width 2px, padding-right 16px
  • Container: min-height 40px

Mobile

  • Label: padding-top and padding bottom 16px
  • Progress line: width 2px
  • Shadow: height 8px, border-top 1px
  • Container: height 56px

Accessibility

[technical requirements]

Content guidelines

Labels

Labels should:

  • Contain one to three words.
  • Have the same name as the sub-heading on the page
  • Be clear and predictable. Users need to know what to find under each sub-heading.
  • Make sure the sub-headings are recognizable as key elements of the page.
  • Make sure the words you use in the anchor links are exactly the same as the words in the sub-headings they refer to.
  • Avoid unnecessary words and articles such as “the”, “a” or “an”.

Best practices

Dos

Anchor navigations should:

  • Allow the user to return to a previous step to review the process
  • Create a clear path to completion
  • Be clear as possible in order not to confuse users
  • Bring the user to the specific topic he is clicking on
  • Show the subheadings preceding the current subheading as active
  • Continue on the next line for very long labels
  • Be sticky
  • Hide the menu overlay on mobile if a user clicked on a subject
  • Show that the lines fill up as soon as a user scrolls

Don’ts

Anchor navigations should:

  • Not have more than 3 lines on desktop
  • Not only the current subheading as active where you are, but also all previous subheadings

References

https://www.agconsult.com/en/usability-blog/anchor-links-dos-and-donts/ https://www.nngroup.com/articles/in-page-links/