@bbc/psammead-heading-index

3.0.30 • Public • Published

psammead-heading-index - Known Vulnerabilities Dependency Status peerDependencies Status Storybook GitHub license npm version PRs Welcome

Description

The HeadingIndex uses a h1 HTML element and is used on index pages, such as IDX, FIX and Most Read.

Installation

npm install @bbc/psammead-heading-index

Props

Argument Type Required Default Example
script object yes latin { 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', }, }, }
service string yes N/A 'news'

Usage

import HeadingIndex from '@bbc/psammead-heading-index';
import { latin } from '@bbc/gel-foundations/scripts';

const Wrapper = () => (
  <Fragment>
    <HeadingIndex script={latin} service="news">
      Heading
    </HeadingIndex>
  </Fragment>
);

When to use this component

This component is designed to be used once at the top of the page.

The HeadingIndex can take an optional id attribute which can be used as an anchor when referencing content.

<HeadingIndex id="content" script={latin} service="news">
  Heading
</HeadingIndex>

Accessibility notes

The HeadingIndex component has a tabindex of -1, this ensures that it is focusable by assitive technology.

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.

Readme

Keywords

Package Sidebar

Install

npm i @bbc/psammead-heading-index

Weekly Downloads

1

Version

3.0.30

License

Apache-2.0

Unpacked Size

17.4 kB

Total Files

9

Last publish

Collaborators

  • news-vj-bot
  • silver-jenkins
  • bbc-web-core
  • ibl-jenkins
  • iplayer-web-jenkins
  • sport-web-jenkins
  • bbcconnections
  • bbc-gnl-ci
  • bbc-morph
  • itv-ci-machine
  • audienceplatformdev
  • bbc-archivesearch-development-team
  • sounds-web-jenkins
  • rmsdev
  • bbc-voice-pipeline
  • weather-jenkins
  • newslabs-jenkins
  • api-management-jenkins
  • mdtbuild
  • bbc-online
  • cps-support
  • bbc-cd-jenkins
  • locator-deploy
  • bbc-isite
  • travel-jenkins
  • participation-jenkins
  • bbc-news-jenkins
  • bbcrd
  • ibl
  • iplayerradio-aws
  • media-playout-jenkins
  • partner-platform-jenkins
  • bbc-admin
  • gel-jenkins
  • pcs-amp-jenkins
  • education-jenkins
  • insyn-jenkins
  • kite-jenkins
  • bbcrd-artifactory
  • iplayer-pc-downloads-pipeline-bot