Generalised Lead Asset component for templates to consume & style
npm install @times-components/article-lead-assetAn article lead asset is an unstyled image or video (asset) with an inline
caption. The caption is rendered using the renderProps React convention. Consumers are
responsible for styling the lead asset by placing it inside of a container
and/or by styling the component returned by the caption renderProp.
``js`
// Image
displayImage={{
ratio: "16:9"
url: "http://crop169.io"
}}
leadAsset={{
caption: "Caption text"
credits: "Credits text"
crop169: {
ratio: "16:9"
url: "http://crop169.io"
}
}}
renderCaption={({ caption }) =>
// Specify the width to render the asset at, this is used for lazy loading
width={600}
/>
Please read CONTRIBUTING.md before contributing to this
package
Please see our main README.md to get the project running locally
The code can be formatted and linted in accordance with the agreed standards.
``
yarn fmt
yarn lint
```
yarn test:web
Visit the official storybook