New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@bbc/psammead-navigation

Package Overview
Dependencies
Maintainers
38
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bbc/psammead-navigation

A navigation bar to use on index pages

  • 2.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-98.75%
Maintainers
38
Weekly downloads
 
Created
Source

psammead-navigation - Known Vulnerabilities Storybook GitHub license npm version PRs Welcome

Description

The @bbc/psammead-navigation package is a set of two components, NavigationUl and NavigationLi. They use ul and li HTML elements respectively.

Installation

npm install @bbc/psammead-navigation

Props

Navigation

ArgumentTypeRequiredDefaultExample
childrennodeYesN/A<NavigationUl><NavigationLi url="/" script={latin} active="true">Home</NavigationLi><NavigationLi url="/sport" script={latin}>{Sport}</NavigationLi></NavigationUl>
scriptobjectYesN/A{ canon: { groupA: { fontSize: '28', lineHeight: '32',}, groupB: { fontSize: '32', lineHeight: '36', }, groupD: { fontSize: '44', lineHeight: '48', }, }, trafalgar: { groupA: { fontSize: '20', lineHeight: '24', }, groupB: { fontSize: '24', lineHeight: '28', }, groupD: { fontSize: '32', lineHeight: '36', }, }, }
skipLinkTextstringYesN/ASkip to content
servicestringYesN/A'news'

NavigationUl

ArgumentTypeRequiredDefaultExample
childrennodeYesN/A<NavigationLi url="/" script={latin} active="true">Home</NavigationLi><NavigationLi url="/sport" script={latin}>{Sport}</NavigationLi>

NavigationLi

ArgumentTypeRequiredDefaultExample
urlstringYesN/A/sport
scriptobjectYesN/A{ canon: { groupA: { fontSize: '28', lineHeight: '32',}, groupB: { fontSize: '32', lineHeight: '36', }, groupD: { fontSize: '44', lineHeight: '48', }, }, trafalgar: { groupA: { fontSize: '20', lineHeight: '24', }, groupB: { fontSize: '24', lineHeight: '28', }, groupD: { fontSize: '32', lineHeight: '36', }, }, }
dirstringNoltrrtl
activebooleanNofalsetrue
currentPageTextstringNonullCurrent page
servicestringYesN/A'news'

Usage

import React from 'react';
import Navigation, {
  NavigationUl,
  NavigationLi,
} from '@bbc/psammead-navigation';
import { latin } from '@bbc/gel-foundations/scripts';

<Navigation script={latin} skipLinkText="Skip to content" service="news">
  <NavigationUl>
    <NavigationLi
      url="/"
      script={latin}
      active="true"
      currentPageText="Current Page"
      service="news"
    >
      Home
    </NavigationLi>
    <NavigationLi url="/sport" script={latin} service="news">
      {Sport}
    </NavigationLi>
    <NavigationLi url="/weather" script={latin} service="news">
      {Weather}
    </NavigationLi>
  </NavigationUl>
</Navigation>;

When to use this component

The Navigation is designed to show a navigation bar on index pages, which will show all sections on a site. If there are too many items to fit on one line, the items will wrap to the next lines.

Accessibility notes

The Navigation has a navigation landmark to provide a way to identify links that are intended to be used for navigation.

It includes a "skip link" giving users the option to skip to the main content before the assistive technology reads the full content of the interjection.

We have added the role list and listitem to the NavigationUl and NavigationList respectively, due to a VoiceOver bug to reinstate the list semantics.

We have also added visually hidden text to let the user know which item in the Navigation is the current page. Note the use of visually hidden text here is due to lack of support at this time for the aria-current page attribute. Also note the use of role="text" to stop splitting in VoiceOver.

Contributing

Psammead is completely open source. We are grateful for any contributions, whether they be new components, bug fixes or general improvements. Please see our primary contributing guide which can be found at the root of the Psammead respository.

Code of Conduct

We welcome feedback and help on this work. By participating in this project, you agree to abide by the code of conduct. Please take a moment to read it.

License

Psammead is Apache 2.0 licensed.

Keywords

FAQs

Package last updated on 12 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc