@bbc/psammead-script-link

3.0.32 • Public • Published

psammead-script-link - Known Vulnerabilities Dependency Status peerDependencies Status Storybook GitHub license npm version PRs Welcome

Description

The ScriptLink component is designed to be used where a service has multiple variants and there is a need to switch between them.

Installation

npm install @bbc/psammead-script-link --save

Props

Argument Type Required Default Example
script object yes N/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', }, }, }
service string yes N/A 'serbian'
href string yes N/A 'https://www.bbc.com/serbian/lat'
variant string no null 'lat'
children node yes N/A 'Lat'
onClick func no () => {} () => console.log('set preferred service variant cookie')

Usage

import ScriptLink from '@bbc/psammead-script-link';
import { latin } from '@bbc/gel-foundations/scripts';

const WrappingComponent = () => (
  <div>
    <ScriptLink
      script={latin}
      service="serbian"
      href="https://www.bbc.com/serbian/lat"
      variant="lat"
      onClick={onClick}
    >
      Lat
    </ScriptLink>
  </div>
);

When to use this component

The ScriptLink component is to be used on the Brand component.

Accessibility notes

When navigating to the ScriptLink using a screen reader, it is identified as a link.

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 repository.

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-script-link

Weekly Downloads

1

Version

3.0.32

License

Apache-2.0

Unpacked Size

37.3 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