A component that displays a list of cards, either in a slideshow or adjacent to one another.
// using with TinaCMS
import { Breadcrumbs } from 'ssw-tinacms-landingkit/dist/';
import * as Icons from 'react-icons/<library>';
<CardCarousel
icons={Icons}
callbackFunctions={{
'<callback-function-1>': () => {
//behaviour
},
'<callback-function-n>': () => {
//behaviour
},
}}
data={
{
// ...<data from tina>}
}
}
/>;
// using with out TinaCMS
<CardCarousel
icons={AntIcons}
callbackFunctions={{
'Alert user': () => {
console.log('you clicked the button');
},
}}
data={{
categoryGroup: [
{
categoryName: '<category-name>',
cardGuidList: {
cardGuidList: ['1'],
},
},
{
categoryName: '<category-name>',
cardGuidList: {
cardGuidList: ['2'],
},
},
],
isH1: false,
isStacked: false,
heading: '<heading>',
body: '<flavor-text>',
buttons: [
{
buttonText: '<button-1>',
callbackFunction: 'Alert user',
icon: '<icon-name>',
color: 'Primary',
},
{
buttonText: '<button-n>',
buttonLink: '<url>',
callbackFunction: null,
icon: '<icon-name>',
color: 'Secondary',
},
],
cardStyle: 'Glass',
cards: [
{
guid: '1',
chips: {
filledChipText: '<chip-text>',
clearChipText: '<chip-text>',
},
mediaType: 'image',
image: '<image-url>',
altText: '<image-alt-text>',
heading: '<card-1-heading>',
description: '<card-1-description>',
featureList: {
features: [
{
heading: '<feature-1>',
description: '<feature-1-description>',
icon: 'AiOutlineCheck',
},
{
heading: '<feture-2>',
description: '<feature-1-description>',
icon: 'AiOutlineCheck',
},
],
},
embeddedButton: {
buttonText: '<button-text>',
buttonLink: '<url>',
icon: 'AiOutlineArrowRight',
},
},
{
guid: '2',
chips: {
filledChipText: '<chip-text>',
clearChipText: '<chip-text>',
},
mediaType: 'youtube',
youtubeUrl: 'https://www.youtube.com/watch?v=<video-id>',
heading: '<card-2-heading>',
description: '<card-2-description>',
featureList: {
features: [
{
heading: '<feature-1>',
description: '<feature-1-description>',
icon: 'AiOutlineCheck',
},
{
heading: '<feature-2>',
description: '<feature-2-description>',
icon: 'AiOutlineCheck',
},
],
},
embeddedButton: {
buttonText: '<button-text>',
buttonLink: '<url>',
icon: 'AiOutlineArrowRight',
},
},
],
}}
/>;
data
: Object containing the breadcrumb contentcategoryGroup
:categoryName
: The name of the group the cards will sit undercardGuidList
: an object containing the list of card guids assigned to the tabcardGuidList
: a list of guids for the cards that will display when this tab is clicked
isH1
: Whether or not the title of the component will use a level 1 headingbody
: some flavor text that will display above the cardsbuttons
: an array of buttons that will display beneath the card listbuttonText
: the text that will show inside of the buttonbuttonLink
: an optional hyperlink to wrap the button withcallbackFunction
: a string matching the key of the callback function that fires on click (passed in viacallbackFunctions
)icon
: the name of the icon component that will display next to the buttoniconFirst
: a boolean indicating whether the embedded icon (if present) will display before or after the button textcolor
: a string indicating the style of the button ("Primary" or "Secondary")
cardStyle
: a string indicating the style for the cards ("Glass" or "Transparent")cards
:guid
: an ID representing the card (used in the categoryGroup field)chips
: an object containing the text for the pills below the button imagefilledChipText
: the text in the left-hand filled chipclearChipText
: the text in the right-hand clear chip
mediaType
: a string indicating the type of media that will be shown in the card ("image" or "youtube")youtubeUrl
: https://www.youtube.com/watch?v=,heading
: The heading at the top of the carddescription
: The flavor text for the card,featureList
: an object containing informationfeatures
: an array used to populate the list at the bottom of the buttonheading
: the heading of the list itemdescription
: the description displayed under the heading for the feature list itemicon
: the name of the icon from theicons
field the button uses
embeddedButton
: The link displayed at the bottom of the cardbuttonText
: '',buttonLink
: The name of the icon from theicons
field the button usesicon
: The name of the icon from theicons
field the button uses
icons
: a dictionary containing the icons the user can chose from as React componentscallbackFunctions
: A dictionary of callback functions the user can bind to any button inbuttons