@bbc/psammead-byline
v3.0.32
Published
A component that displays an author's name, title, and optional avatar.
Downloads
57
Maintainers
Keywords
Readme
psammead-byline -
Description
The Byline
component is designed to display an author's full name, title, and optional avatar.
Installation
npm install @bbc/psammead-byline --save
Props
| Argument | Type | Required | Default | Example |
| ----------------- | --------- | -------- | --------- | ------------------------------ |
| service | string | Yes | N/A | 'news'
|
| avatar | object | No | null
| See below. |
| name | string | Yes | N/A | 'John Smith'
|
| title | string | Yes | N/A | 'Art editor'
|
Avatar
| Argument | Type | Required | Default | Example |
| ----------------- | --------- | -------- | --------- | -------------------------------- |
| src | string | Yes | N/A | 'http://www.bbc.co.uk/img.jpg'
|
| alt | string | No | null
| 'A person wearing glasses.'
|
Usage
import Byline from "@bbc/psammead-byline"
<Byline
service='news'
avatar={{ src: 'http://www.bbc.co.uk/john-smith.jpg' }}
name="John Smith"
title="Art editor"
/>
When to use this component
This component should be used when crediting the author of a piece of content, such as an article.
When not to use this component
N/A.
Accessibility notes
By default the avatar img
is rendered with an empty alt
attribute as it is expected to be of the person, which the adjacent name describes.
Roadmap
There are no known future changes to this component.
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.