Skip to main content

RelatedTeaser: React

A RelatedTeaser highlights associated articles, seamlessly integrating within the main content to guide readers to related insights.

Installation

Before you can start using the @mediahuis/chameleon-react component, you'll need to install it, for more information check: Getting started for developers.

With that done, you're now ready to implement the component in your application.

import { RelatedTeaser } from '@mediahuis/chameleon-react';

export default function Example() {
return <RelatedTeaser prefix="Prefix" title="Title" link="#" />;
}

Properties

PropertyTypeDefaultRequiredDescription
classNameString-NoAllows extending the class names of the teaser.
linkString | ReactNode-YesYou can pass a simple URL as string, or you could supply your own component if you would like to add custom props to it (e.g. if you want to add target="_blank")
imageElementType | ReactElement-NoThe image to be shown in the teaser.
imageOptionsUnknown{}NoOptions to add to the image, such as aspect-ratio
prefixString-NoDescribes the prefix to be shown before the title, e.g., "Read more:"
testIDsUnknown{}NoTest IDs for automated testing.
titleString-YesThe display title of the teaser.
titleTagName'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span''h3'NoThe html-tag to be used for the title.