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

@bbc/psammead-live-label

Package Overview
Dependencies
Maintainers
40
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bbc/psammead-live-label

React component for a live label

  • 2.0.35
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
40
Created
Source

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.

Keywords

FAQs

Package last updated on 30 Mar 2022

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