@bbc/psammead-paragraph

React component for a Paragraph

Usage no npm install needed!

<script type="module">
  import bbcPsammeadParagraph from 'https://cdn.skypack.dev/@bbc/psammead-paragraph';
</script>

README

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

Description

The @bbc/psammead-paragraph package exports a single Paragraph component. It uses a p HTML element.

It uses @bbc/psammead-styles for colours and font family and @bbc/gel-foundations for spacing and for GEL Typography implemented in Styled Components.

Installation

npm install @bbc/psammead-paragraph

Props

Argument Type Required Default Example
Script object yes latin { 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 'news'
darkMode bool no false true

Usage

import Paragraph from '@bbc/psammead-paragraph';
import { latin } from '@bbc/gel-foundations/scripts';

const WrappingComponent = () => (
  <Paragraph script={latin} service="news">
    Text here
  </Paragraph>
);

When to use this component

This component can be used at any point on a page.

Accessibility notes

Since this is just a <p> tag with associated styles, when you use this component, it has the same semantic meaning as a regular paragraph element.

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

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.