2.0.35 • Published 2 years ago

@bbc/psammead-live-label v2.0.35

Weekly downloads
1,194
License
Apache-2.0
Repository
github
Last release
2 years ago

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

ArgumentTypeRequiredDefaultExample
servicestringyesN/A'news'
dirstringno'ltr''rtl'
ariaHiddenboolnofalsetrue
liveTextstringno'LIVE''Localised Live'
offScreenTextstringnonull'Live'
langstringno'en-GB''en-GB'
childrennodenonull<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.

2.0.35

2 years ago

2.0.34

2 years ago

2.0.33

2 years ago

2.0.32

2 years ago

2.0.30

3 years ago

2.0.29

3 years ago

2.0.28

3 years ago

2.0.26

3 years ago

2.0.27

3 years ago

2.0.24

3 years ago

2.0.25

3 years ago

2.0.23

3 years ago

2.0.22

3 years ago

2.0.21

3 years ago

2.0.20

3 years ago

2.0.19

3 years ago

2.0.18

3 years ago

2.0.17

3 years ago

2.0.16

3 years ago

2.0.15

3 years ago

2.0.14

3 years ago

2.0.13

3 years ago

2.0.12

3 years ago

2.0.11

3 years ago

2.0.10

3 years ago

2.0.9

3 years ago

2.0.8

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.0-alpha.2

4 years ago

0.1.0-alpha.1

4 years ago