Displays a source attribution in block capitals in the bottom-right of the parent element. This implementation is primarily intended for use alongside images.
npm install @bbc/psammead-copyright
const WrapperComponent = alt ratio src width<Figure><ImagePlaceholder =><Image = = = /><Copyright><VisuallyHiddenText>Image source </VisuallyHiddenText>Getty Images</Copyright></ImagePlaceholder></Figure>;
When to use this component
This component is intended to be used alongside images or diagrams contained within a Figure component.
When not to use this component
This component should not be used arbitrarily to represent source attribution across the page. As above, it is not intended to be used outside the Figure component. The accessibility text would be incorrect and potentially confusing.
Do not use this component if you know the source attribution is already covered by another copyright disclosure on the page, such as in
The default styling of this component is intended to comply with WCAG colour contrast standards.
VisuallyHiddenText component can be used as a child of
Copyright to add additional context to screen reader users. An example of this can be found in our storybook
This component uses aria role text, to stop 'text splitting' that is observed when using VoiceOver on iPhone and therefore improve the screen reader UX. Without this, the image source element is 2 swipes on VoiceOver (left to right), one for 'Image source' and one for the actual source such as 'Getty images'.
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.