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.
npm install @bbc/psammead-paragraph
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 |
import Paragraph from '@bbc/psammead-paragraph';
import { latin } from '@bbc/gel-foundations/scripts';
const WrappingComponent = () => (
<Paragraph script={latin} service="news">
Text here
</Paragraph>
);
This component can be used at any point on a page.
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.
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.
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.