TeaserCard / Dev

Install

yarn add @ntds/media-card

Import

import { TeaserCard } from '@ntds/media-card';

Props

TeaserCard

PropType & Description
backgroundColor
string

hex value for card background color

textColor
string

hex value for text color

footer
{ message?: string; logo?: { name: string; title: string; }; button?: { url: string; label: string; onClick?: () => void; }; colorTint: string; legalText?: string; }

footer

media
MediaType

media

link
{ url: string; label: string; onClick?: () => void; }

Card link

linkComponent
React.ComponentType<any>

The component to use for rendering links.

Typically, this is a React Router Link component and only needs to be set in OmniWeb since the links are SPA-links inside OmniWeb.

If not defined (default), the component will render a regular anchor tag.

renderImage
(className: string, media: MediaImage) => ReactNode

Provide a function that renders the image.

Example:

renderImage={(classNames) => (
 <img
   className={classNames}
   alt=''
   src='my-image.jpg'
 />
)}

This guide is based on version: 1.4.1