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

@posten-hedwig/navbar

v4.1.1

Published

Provides navbar and menu

Downloads

83

Readme

Navbar

The navbar is the container for primary navigation on the Posten and Bring websites and applications. It is placed at the top of every page.

Usage

Install

npm install @posten-hedwig/navbar

Icons

Hedwig is using icons from Font Awesome Pro wich requires a licence. The auth token from your licence will need to be added to an environment variable. For Posten and Bring developers, please contact the Hedwig contributors for this token. For other users, a licence can be obtained here

Import

import { Navbar } from '@posten-hedwig/navbar'

Render

<Navbar
    logo='posten'
    logoAriaLabel='Go to homepage'
    logoHref='#'
    logoTitle='Posten Logo'
    skipToMainHref='#content'
    skipToMainTitle='Main content'
    menuOpenName="Menu"
    menuOpenTitle="Open menu" />

API

Navbar logoTitle

This prop specifies the alt text for the logo.

Navbar logo

This prop specifies which logo to use for the navbar. 'posten' and 'bring' are available

Navbar logoHref

This prop is the link to where the logo is leading to

Navbar logoAriaLabel

Specifies the Aria Label for the logo

Navbar skipToMainHref

Links to the main content on the page. For example href='#main'

Navbar skipToMainTitle

Title for the skipToMainHref

Navbar flagship

This prop specifies the Flagship name. Will show to the right of the logo

Navbar selectorItems

This prop is two or more links to different sections on the app/website. For example this could be a switch between private and business sections.

import { Navbar } from '@posten-hedwig/navbar'
import { Link } from '@posten-hedwig/link'
…
<Navbar
    /* other props goes here */
    selectorItems={[
        {
            link: <Link href="#">Business</Link>
        },
        {
            link: <a href="#">Private</a>,
            selected: true
        }
    ]}
/>

Navbar menuOpenName

Name showing on the menu button on desktop. When the menu is open the menuCloseName will show instead. Required when any items are to be shown in the menu.

Navbar menuOpenTitle

Title for menu button for mouse over When the menu is open, menuCloseTitle will show instead. Required when any items are to be shown in the menu.

Navbar menuCloseName

Name showing on the menu button on desktop when the menu is open. When the menu is closed menuOpenName will show instead. Required when any items are to be shown in the menu.

Navbar menuCloseTitle

Title for menu button for mouse over when the menu is open. When the menu is open menuOpenTitle will show instead. Required when any items are to be shown in the menu

Navbar menuSections

Specify the main sections including items that are in the menu. Each section consists of a title and an array of links. Can be either links with href, React Router Links or Hedwig Links.

import { Navbar } from '@posten-hedwig/navbar'
import { Link } from '@posten-hedwig/link'
…
<Navbar
    /*…*/
    menuSections={[
        {
            title: 'Send',
            links: [
                <Link href='#'>Parcels abroad</Link>,
                <Link href='#'>Parcels in Norway</Link>,
                <Link href='#'>Letters in Norway</Link>,
                <Link href='#'>Return</Link>,
                <Link href='#'>Letters abroad</Link>,
                <Link href='#'>Addressing and wrapping</Link>,
                <Link href='#'>Customs when sending abroad</Link>
            ]
        },
        {
            title: 'Receive',
            links: [
                <Link href='#'>On what days does my mail arrive?</Link>,
                <Link href='#'>Home delivery</Link>,
                <Link href='#'>Pick up yourself</Link>,
                <Link href='#'>Customs when receiving</Link>
            ]
        }
    ]}
/>

Navbar menuFeaturedLinks

Specify items that are featured in the menu. This is an array of links with icons. Can be either links with href, React Router Links or Hedwig Links.

Example Navbar with menuFeaturedLinks

import { Navbar } from '@posten-hedwig/navbar'
import { Link } from '@posten-hedwig/link'
import { Icon, sporing, leverttilbedrift, avis, kundeservice } from '@posten-hedwig/icon'
…
<Navbar
    /*…*/
    menuFeaturedLinks={[
        <Link href='#'>
            <Icon icon={sporing} size='medium' title='Track a shipment' />
            Track a shipment
        </Link>,
        <Link href='#'>
            <Icon icon={leverttilbedrift} size='medium' title='Mybring' />
            Mybring
        </Link>,
        <Link href='#'>
            <Icon icon={avis} size='medium' title='Magazine' />
            Magazine
        </Link>,
        <Link href='#'>
            <Icon icon={kundeservice} size='medium' title='Contact us' />
            Contact us
        </Link>
    ]}
/>