Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@bbc/psammead-live-label

bbc760Apache-2.02.0.35

React component for a live label

bbc, live

readme

psammead-live-label - Known Vulnerabilities Dependency Status peerDependencies Status Storybook GitHub license npm version PRs Welcome

Description

The LiveLabel component implements a span for use on live content.

Installation

npm install @bbc/psammead-live-label --save

Props

Argument Type Required Default Example
service string yes N/A 'news'
dir string no 'ltr' 'rtl'
ariaHidden bool no false true
liveText string no 'LIVE' 'Localised Live'
offScreenText string no null 'Live'
lang string no 'en-GB' 'en-GB'
children node no null <span>Headline</span>

Usage

import LiveLabel from '@bbc/psammead-live-label';
import { Headline, Link } from '@bbc/psammead-story-promo';
import { latin } from '@bbc/gel-foundations/scripts';

<Headline script={latin} service="news">
  <Link href="https://www.bbc.co.uk/news">
    <LiveLabel service={service} dir={dir} ariaHidden offScreenText="Live">
      The headline of the live promo
    </LiveLabel>
  </Link>
</Headline>;

When to use this component

The LiveLabel component can be used inside a Link in index pages to show a promo for a Live page.

Accessibility notes

The LiveLabel example above shows this component being hidden to screen readers with visually hidden text rendered alongside it. This is to ensure the screen reader announces the word 'Live' correctly. This does not need to be accounted for in other languages.

The ariaHidden prop is needed as styled components strips out aria tags on a server render.

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.

changelog

Live Label Changelog

Version Description
2.0.35 PR#4633 bump psammead-styles
2.0.34 PR#4632 psammead-styles bump
2.0.33 PR#4609 Bump from psammead-styles
2.0.32 PR#4597 Bump to solve deploying issue
2.0.31 PR#4591 Fix TalkBack reading nested spans incorrectly
2.0.30 PR#4574 Bumps psammead-styles
2.0.29 PR#4568 Bump dependencies
2.0.28 PR#4565 Bump from psammead-styles
2.0.27 PR#4562 Bump psammead-styles
2.0.26 PR#4561 Bump dependencies for @bbc/psammead-styles
2.0.25 PR#4548 Bumps dependencies
2.0.24 PR#4547 Bumps packages
2.0.23 PR#4545 Bump dependencies for @bbc/psammead-styles
2.0.22 PR#4552 Bump psammead-styles
2.0.21 PR#4497 Bump psammead-styles
2.0.20 PR#4486 upgrade minor/patch dependencies
2.0.18 PR#4420 bumps 3rd-party dependencies
2.0.17 PR#4368 use Yarn Workspaces
2.0.16 PR#4335 switch to yarn for package management
2.0.15 PR#4304 Talos - Bump Dependencies - @bbc/gel-foundations, @bbc/psammead-styles, @bbc/psammead-visually-hidden-text
2.0.14 PR#4303 Trigger rebuild following babel config update for emotion 11
2.0.13 PR#4271 change react peer dep to >=16.9.0
2.0.12 PR#4266 Talos - Bump Dependencies - @bbc/psammead-visually-hidden-text
2.0.11 PR#4260 Talos - Bump Dependencies - @bbc/gel-foundations
2.0.10 PR#4256 Talos - Bump Dependencies - @bbc/psammead-styles
2.0.9 PR#4193 Upgrade Emotion to v11
2.0.8 PR#4226 Talos - Bump Dependencies - @bbc/psammead-styles
2.0.7 PR#4189 Talos - Bump Dependencies - @bbc/psammead-styles
2.0.6 PR#4072 Talos - Bump Dependencies - @bbc/psammead-styles
2.0.5 PR#4052 Talos - Bump Dependencies - @bbc/gel-foundations
2.0.4 PR#4029 Talos - Bump Dependencies - @bbc/psammead-styles
2.0.3 PR#3944 Talos - Bump Dependencies - @bbc/psammead-styles
2.0.2 PR#3925 Talos - Bump Dependencies - @bbc/psammead-styles, @bbc/psammead-visually-hidden-text
2.0.1 PR#3924 Migrate storybook to Emotion
2.0.0 PR#3879 Migrate to Emotion
1.0.3 PR#3883 Talos - Bump Dependencies - @bbc/psammead-assets, @bbc/psammead-image, @bbc/psammead-styles, @bbc/psammead-visually-hidden-text
1.0.2 PR#3728 Tweaks following Storybook v5.3.19 to v6.0.22 update
1.0.1 PR#3709 Bump prettier from 2.0.5 to 2.1.1
1.0.0 PR#3293 Remove alpha tag
0.1.0-alpha.2 PR#3276 Remove withOffScreenText prop.
0.1.0-alpha.1 PR#3224 Initial creation of package.