/image-rendering

Handles parsing images from CAPI and rendering them in the *-rendering projects

Primary LanguageTypeScriptApache License 2.0Apache-2.0

image-rendering

⚠️ Deprecated ⚠️: This functionality has been migrated to the DCR/AR mono-repo: https://github.com/guardian/dotcom-rendering.

Handles parsing images from CAPI and rendering them in the *-rendering projects

Components

BodyImage

This used for images in the body of articles.

<BodyImage
    image={Image}
    format={Format}
    supportsDarkMode={boolean}
    lightbox={Option<Lightbox>}
    caption={Option<ReactNode>}
/>

FigCaption

<FigCaption
    format={Format}
    supportsDarkMode={boolean}
    children={Option<ReactNode>}
/>

Img

Lowest-level implementation of a responsive image.

<Img
    image={Image}
    sizes={Sizes}
    className={Option<SerializedStyles>}
    format={Format}
    supportsDarkMode={boolean}
    lightbox={Option<Lightbox>}
/>

Storybook

You can get storybook to run locally by running:

npm run storybook