Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@bbc/psammead-live-label
Advanced tools
The LiveLabel
component implements a span for use on live content.
npm install @bbc/psammead-live-label --save
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> |
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>;
The LiveLabel
component can be used inside a Link
in index pages to show a promo for a Live page.
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.
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.
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.
Psammead is Apache 2.0 licensed.
FAQs
React component for a live label
We found that @bbc/psammead-live-label demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 40 open source maintainers collaborating on the project.
Did you know?
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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.