HeroBlockBanner
Carousel/slider hero area built from slides.
Includes the common banner props.
Types
type HeroSlide = {
id: string;
background: ImageProps | null;
video: VideoProps | null;
title: Maybe<string>;
titleTag: 'h1' | 'h2';
text: Maybe<string>;
buttonText: Maybe<string>;
buttonLink: DynamicLink | null;
style: Maybe<string>;
theme: Theme | null;
};Props
id●required
string
CMS id.
slides●required
HeroSlide[]
Slides rendered in order.
background: optional image
video: optional video (can replace background)
buttonLink: optional link
theme: optional per-slide theme
Notes
- If both
backgroundandvideoare present, the renderer must decide precedence. titleTagis per-slide to allow the first slide to beh1while others areh2.themeis documented in Theme.
Example
const banner: HeroBlockBanner = {
typename: BannerTypename.HeroBlock,
id: 'b_123',
title: null,
titleTag: 'h2',
titleAlign: 'left',
cssId: null,
cssClasses: null,
slides: [
{
id: 's1',
background: { id: 'img1', name: 'Hero', imageRights: null, file: {} as any, mobileFile: null, alt: 'Hero', breakpoint: null, cars: [] },
video: null,
title: 'Welcome',
titleTag: 'h1',
text: 'Intro text...',
buttonText: 'Explore',
buttonLink: { label: 'Explore', isAbsolute: false, url: '/explore', query: [] },
style: null,
theme: null
}
]
};