Use Banner...
- To showcase promotional offers and seasonal events.
- To simplify user journeys by presenting clear call-to-action.
- To reinforce brand perception through visual storytelling.
- For what it’s intended for —pairing text and imagery with marketing or editorial purpose.
Don't use Banner...
- To provide critical information to customers. Use Alert Box instead.
- To display a large variety of content. Use Standard Tile or Card instead.
- If its presentation needs to deviate from its orginal marketing and editorial purpose. Combine other SWAN components to create your desired layout. Find out more.
Card
In the React API, card
is the default Banner variant, while in the Vanilla API, you need to explicitly specify the variant.
A Banner with variant="card"
features a BannerTextContainer
aligned to the left by default, and a BannerImageContainer
that covers the remaining half of the Banner.
The preview has been updated.
<Banner><BannerTextContainer><BannerText><BannerEyebrow>Optional eyebrow</BannerEyebrow><BannerTitle>Title line with a message</BannerTitle><BannerDescription><p>Description to give a better idea of what is presented on the banner.</p></BannerDescription><BannerPrice>$123.45</BannerPrice><BannerLinks><Button skin="primary">Button</Button></BannerLinks><BannerFootnote>An optional footnote can go below the button.</BannerFootnote></BannerText></BannerTextContainer><BannerImageContainer><BannerImage><FluidImage src="/example-images/16x9.webp" alt="Placeholder" /></BannerImage></BannerImageContainer></Banner>
<div class="swan-banner swan-banner-card"><div class="swan-banner-text-container"><div class="swan-banner-text"><p class="swan-banner-eyebrow">Optional eyebrow</p><p class="swan-banner-title">Title line with a message</p><div class="swan-banner-description"><p>Description to give a better idea of what is presented on the banner.</p></div><p class="swan-banner-price">$123.45</p><div class="swan-banner-links"><button type="button" class="swan-button swan-button-skin-primary">Button</button></div><p class="swan-banner-footnote">An optional footnote can go below the button.</p></div></div><div class="swan-banner-image-container"><div class="swan-banner-image"><imgsrc="https://www.picsum.photos/800/300?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div></div>
Text box alignment (Card)
Use textBoxHorizontalAlign="right"
to align the text box to the right.
The preview has been updated.
<Banner variant="card" textBoxHorizontalAlign="right"><BannerTextContainer><BannerText><BannerEyebrow>Optional eyebrow</BannerEyebrow><BannerTitle>Title line with a message</BannerTitle><BannerDescription><p>Description to give a better idea of what is presented on the banner.</p></BannerDescription><BannerPrice>$123.45</BannerPrice><BannerLinks><Button skin="primary">Button</Button></BannerLinks><BannerFootnote>An optional footnote can go below the button.</BannerFootnote></BannerText></BannerTextContainer><BannerImageContainer><BannerImage><FluidImage src="/example-images/16x9.webp" alt="Placeholder" /></BannerImage></BannerImageContainer></Banner>
<divclass="swan-banner swan-banner-card swan-banner-text-box-horizontal-align-right"><div class="swan-banner-text-container"><div class="swan-banner-text"><p class="swan-banner-eyebrow">Optional eyebrow</p><p class="swan-banner-title">Title line with a message</p><div class="swan-banner-description"><p>Description to give a better idea of what is presented on the banner.</p></div><p class="swan-banner-price">$123.45</p><div class="swan-banner-links"><button type="button" class="swan-button swan-button-skin-primary">Button</button></div><p class="swan-banner-footnote">An optional footnote can go below the button.</p></div></div><div class="swan-banner-image-container"><div class="swan-banner-image"><imgsrc="https://www.picsum.photos/800/300?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div></div>
Two images
Use twoImages
and set textBoxHorizontalAlign="center"
to display two images on Large and Extra-Large screens. On smaller screens, only the right image will show.
Use preferSecondaryImage
to display the left image instead.
The preview has been updated.
<Banner variant="card" twoImages textBoxHorizontalAlign="center"><BannerTextContainer><BannerText><BannerEyebrow>Optional eyebrow</BannerEyebrow><BannerTitle>Title line with a message</BannerTitle><BannerDescription><p>Description to give a better idea of what is presented on the banner.</p></BannerDescription><BannerPrice>$123.45</BannerPrice><BannerLinks><Button skin="primary">Button</Button></BannerLinks><BannerFootnote>An optional footnote can go below the button.</BannerFootnote></BannerText></BannerTextContainer><BannerImageContainer><BannerImage><FluidImage src="/example-images/16x9-1.webp" alt="Placeholder" /></BannerImage></BannerImageContainer><BannerSecondaryImageContainer data-testid="twoImagesSecondaryImageContainer"><BannerSecondaryImage data-testid="twoImagesSecondaryImage"><FluidImage src="/example-images/16x9-2.webp" alt="Placeholder" /></BannerSecondaryImage></BannerSecondaryImageContainer></Banner>
<divclass="swan-banner swan-banner-card swan-banner-text-box-horizontal-align-center swan-banner-two-images"><div class="swan-banner-text-container"><div class="swan-banner-text"><p class="swan-banner-eyebrow">Optional eyebrow</p><p class="swan-banner-title">Title line with a message</p><div class="swan-banner-description"><p>Description to give a better idea of what is presented on the banner.</p></div><p class="swan-banner-price">$123.45</p><div class="swan-banner-links"><button type="button" class="swan-button swan-button-skin-primary">Button</button></div><p class="swan-banner-footnote">An optional footnote can go below the button.</p></div></div><div class="swan-banner-image-container"><div class="swan-banner-image"><imgsrc="https://www.picsum.photos/800/300?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div><divdata-testid="twoImagesSecondaryImageContainer"class="swan-banner-image-container swan-banner-secondary-image-container"><divdata-testid="twoImagesSecondaryImage"class="swan-banner-image swan-banner-secondary-image"><imgsrc="https://www.picsum.photos/800/301?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div></div>
with Left Hand Navigation
Use withLeftHandNavigation
to add a Left Hand Navigation on the left of the Banner. If the navigation is taller than the Banner, it will spill over into the area below the Banner.
Use the BannerWithLeftHandNavigationBelowBanner
helper component to add content below the Banner. This container:
- Adds spacing to the left to ensure that the navigation doesn’t overlap with the content.
- Automatically wraps the content with a Bounded Content component.
The Left Hand Navigation is hidden on Small and Extra-Small screens. Make sure its links are available elsewhere on the page, whether it’s in the top navigation or within the page content.
The preview has been updated.
<><Banner withLeftHandNavigation><LeftHandNavigation><LeftHandNavigationHeader>Left-Hand Nav Heading</LeftHandNavigationHeader><Divider /><LinkList><ListItem><Link href="#">Link</Link></ListItem><ListItem><Link href="#">Link</Link></ListItem><ListItem><Link href="#">Link</Link></ListItem><ListItem><Link href="#">Link</Link></ListItem><ListItem><Link href="#">Link</Link></ListItem></LinkList><Divider /><LinkListHeading>Link list heading</LinkListHeading><LinkList><ListItem><Link href="#">Link</Link></ListItem><ListItem><Link href="#">Link</Link></ListItem><ListItem><Link href="#">Link</Link></ListItem><ListItem><Link href="#">Link</Link></ListItem><ListItem><Link href="#">Link</Link></ListItem><ListItem><Link href="#">Link</Link></ListItem><ListItem><Link href="#">Link</Link></ListItem><ListItem><Link href="#">Link</Link></ListItem></LinkList></LeftHandNavigation><BannerTextContainer><BannerText><BannerTitle>Title line with a message</BannerTitle><BannerDescription>Description to give a better idea of what is presented on the banner.</BannerDescription><BannerLinks><Button skin="primary">Button</Button></BannerLinks></BannerText></BannerTextContainer><BannerImageContainer><BannerImage><FluidImage src="/example-images/16x9.webp" alt="Placeholder" /></BannerImage></BannerImageContainer></Banner><BannerWithLeftHandNavigationBelowBanner data-testid="withLeftNavBelow"><GridContainer><Row><Column span={12}><P>Here is the content that goes below the banner.</P></Column><Column span={4}><StandardTile><StandardTileImage><FluidImagesrc="/example-images/product.webp"alt="Placeholder"/></StandardTileImage><StandardTileContents><StandardTileName><Link href="#" covering skin="unstyled">Tile name</Link></StandardTileName><StandardTileDescription>This tile has a description.</StandardTileDescription></StandardTileContents></StandardTile></Column><Column span={4}><StandardTile><StandardTileImage><FluidImagesrc="/example-images/product-2.webp"alt="Placeholder"/></StandardTileImage><StandardTileContents><StandardTileName><Link href="#" covering skin="unstyled">Tile name</Link></StandardTileName><StandardTileDescription>This tile has a description.</StandardTileDescription></StandardTileContents></StandardTile></Column><Column span={4}><StandardTile><StandardTileImage><FluidImagesrc="/example-images/product-3.webp"alt="Placeholder"/></StandardTileImage><StandardTileContents><StandardTileName><Link href="#" covering skin="unstyled">Tile name</Link></StandardTileName><StandardTileDescription>This tile has a description.</StandardTileDescription></StandardTileContents></StandardTile></Column></Row></GridContainer></BannerWithLeftHandNavigationBelowBanner></>
<divclass="swan-banner swan-banner-card swan-banner-text-box-horizontal-align-left swan-banner-with-left-hand-navigation"><nav class="swan-lhn"><h2 class="swan-lhn-header">Left-Hand Nav Heading</h2><hr class="swan-divider" /><ul class="swan-link-list"><li><a href="#" class="swan-link">Link</a></li><li><a href="#" class="swan-link">Link</a></li><li><a href="#" class="swan-link">Link</a></li><li><a href="#" class="swan-link">Link</a></li><li><a href="#" class="swan-link">Link</a></li></ul><hr class="swan-divider" /><h3 class="swan-link-list-heading">Link list heading</h3><ul class="swan-link-list"><li><a href="#" class="swan-link">Link</a></li><li><a href="#" class="swan-link">Link</a></li><li><a href="#" class="swan-link">Link</a></li><li><a href="#" class="swan-link">Link</a></li><li><a href="#" class="swan-link">Link</a></li><li><a href="#" class="swan-link">Link</a></li><li><a href="#" class="swan-link">Link</a></li><li><a href="#" class="swan-link">Link</a></li></ul></nav><div class="swan-banner-text-container"><div class="swan-banner-text"><p class="swan-banner-title">Title line with a message</p><div class="swan-banner-description">Description to give a better idea of what is presented on the banner.</div><div class="swan-banner-links"><button type="button" class="swan-button swan-button-skin-primary">Button</button></div></div></div><div class="swan-banner-image-container"><div class="swan-banner-image"><imgsrc="https://www.picsum.photos/800/300?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div></div><div class="swan-bounded-content"><div class="swan-banner-with-left-hand-navigation-below-banner"><div class="swan-grid-container"><div class="swan-row"><div class="swan-col-12"><p>Here is the content that goes below the banner.</p></div></div></div></div></div>
Full-width image
A Banner with variant="full-width-image"
features a BannerImageContainer
that spans the entire width and height of the Banner, positioned underneath the BannerTextContainer
.
The preview has been updated.
<Banner variant="full-width-image"><BannerTextContainer><BannerText><BannerEyebrow>Optional eyebrow</BannerEyebrow><BannerTitle>Title line with a message</BannerTitle><BannerDescription><p>Description to give a better idea of what is presented on the banner.</p></BannerDescription><BannerPrice>$123.45</BannerPrice><BannerLinks><Button skin="primary">Button</Button></BannerLinks><BannerFootnote>An optional footnote can go below the button.</BannerFootnote></BannerText></BannerTextContainer><BannerImageContainer><BannerImage><FluidImage src="/example-images/wide-2.webp" alt="Placeholder" /></BannerImage></BannerImageContainer></Banner>
<divclass="swan-banner swan-banner-full-width-image swan-banner-text-box-horizontal-align-left"><div class="swan-banner-text-container"><div class="swan-banner-text"><p class="swan-banner-eyebrow">Optional eyebrow</p><p class="swan-banner-title">Title line with a message</p><div class="swan-banner-description"><p>Description to give a better idea of what is presented on the banner.</p></div><p class="swan-banner-price">$123.45</p><div class="swan-banner-links"><button type="button" class="swan-button swan-button-skin-primary">Button</button></div><p class="swan-banner-footnote">An optional footnote can go below the button.</p></div></div><div class="swan-banner-image-container"><div class="swan-banner-image"><imgsrc="https://www.picsum.photos/800/300?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div></div>
Text box alignment (for Full-Width Image)
Use textBoxHorizontalAlign="center"
to align the text box to the center.
Use textBoxHorizontalAlign="right"
to align the text box to the right.
The preview has been updated.
<Banner variant="full-width-image" textBoxHorizontalAlign="right"><BannerTextContainer><BannerText><BannerEyebrow>Optional eyebrow</BannerEyebrow><BannerTitle>Title line with a message</BannerTitle><BannerDescription><p>Description to give a better idea of what is presented on the banner.</p></BannerDescription><BannerPrice>$123.45</BannerPrice><BannerLinks><Button skin="primary">Button</Button></BannerLinks><BannerFootnote>An optional footnote can go below the button.</BannerFootnote></BannerText></BannerTextContainer><BannerImageContainer><BannerImage><FluidImage src="/example-images/wide-1.webp" alt="Placeholder" /></BannerImage></BannerImageContainer></Banner>
<divclass="swan-banner swan-banner-full-width-image swan-banner-text-box-horizontal-align-right"><div class="swan-banner-text-container"><div class="swan-banner-text"><p class="swan-banner-eyebrow">Optional eyebrow</p><p class="swan-banner-title">Title line with a message</p><div class="swan-banner-description"><p>Description to give a better idea of what is presented on the banner.</p></div><p class="swan-banner-price">$123.45</p><div class="swan-banner-links"><button type="button" class="swan-button swan-button-skin-primary">Button</button></div><p class="swan-banner-footnote">An optional footnote can go below the button.</p></div></div><div class="swan-banner-image-container"><div class="swan-banner-image"><imgsrc="https://www.picsum.photos/800/300?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div></div>
Multi-Column Offer
Use multiColumnOffer
with textBoxHorizontalAlign="center"
to display up to 3 separate offers within the text box.
The preview has been updated.
<Bannervariant="full-width-image"textBoxHorizontalAlign="center"multiColumnOffer><BannerTextContainer><BannerText><BannerEyebrow>Optional eyebrow</BannerEyebrow><BannerOfferColumns data-testid="multiColumnColumns"><BannerOfferColumn data-testid="multiColumnColumn"><BannerDisplay>50% off</BannerDisplay><BannerSubtitle>Subtitle</BannerSubtitle></BannerOfferColumn><BannerOfferColumn><BannerDisplay>30% off but longer</BannerDisplay><BannerSubtitle>Subtitle</BannerSubtitle></BannerOfferColumn><BannerOfferColumn><BannerDisplay>30% off</BannerDisplay><BannerSubtitle>Subtitle that is longer than the others</BannerSubtitle></BannerOfferColumn></BannerOfferColumns><BannerDescription><P>Ends tonight<PipeSeparator />Code: <PromoCode as="span">ABC123</PromoCode></P></BannerDescription><BannerLinks><Button skin="primary">Button</Button></BannerLinks><BannerFootnote>An optional footnote can go below the button.</BannerFootnote></BannerText></BannerTextContainer><BannerImageContainer><BannerImage><FluidImage src="/example-images/wide.webp" alt="Placeholder" /></BannerImage></BannerImageContainer></Banner>
<divclass="swan-banner swan-banner-full-width-image swan-banner-text-box-horizontal-align-center swan-banner-multi-column-offer"><div class="swan-banner-text-container"><div class="swan-banner-text"><p class="swan-banner-eyebrow">Optional eyebrow</p><div class="swan-banner-offer-columns"><div class="swan-banner-offer-column"><p class="swan-banner-display">50% off</p><p class="swan-banner-subtitle">Subtitle</p></div><div class="swan-banner-offer-column"><p class="swan-banner-display">30% off but longer</p><p class="swan-banner-subtitle">Subtitle</p></div><div class="swan-banner-offer-column"><p class="swan-banner-display">30% off</p><p class="swan-banner-subtitle">Subtitle that is longer than the others</p></div></div><div class="swan-banner-description"><p>Ends tonight<span class="swan-pipe-separator">|</span>Code:<span class="swan-promo-code">ABC123</span></p></div><div class="swan-banner-links"><button type="button" class="swan-button swan-button-skin-primary">Button</button></div><p class="swan-banner-footnote">An optional footnote can go below the button.</p></div></div><div class="swan-banner-image-container"><div class="swan-banner-image"><imgsrc="https://www.picsum.photos/800/300?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div></div>
Double Banner
Use DoubleBanner
, as a separate component, to wrap side-by-side, two full-width-image
Banners, with a small gap between.
The preview has been updated.
<DoubleBanner><Banner variant="full-width-image"><BannerTextContainer><BannerText><BannerEyebrow>Optional eyebrow</BannerEyebrow><BannerTitle>Title line with a message</BannerTitle><BannerDescription><p>Description to give a better idea of what is presented on thebanner.</p></BannerDescription><BannerPrice>$123.45</BannerPrice><BannerLinks><Button skin="primary">Button</Button></BannerLinks><BannerFootnote>An optional footnote can go below the button.</BannerFootnote></BannerText></BannerTextContainer><BannerImageContainer><BannerImage><FluidImage src="/example-images/16x9-1.webp" alt="Placeholder" /></BannerImage></BannerImageContainer></Banner><Banner variant="full-width-image"><BannerTextContainer><BannerText><BannerEyebrow>Optional eyebrow</BannerEyebrow><BannerDisplay>30% off</BannerDisplay><BannerSubtitle>Subtitle line with a message</BannerSubtitle><BannerDescription><p>Description to give a better idea of what is presented on thebanner.</p></BannerDescription><BannerPrice>$123.45</BannerPrice><BannerLinks><Button skin="primary">Button</Button></BannerLinks><BannerFootnote>An optional footnote can go below the button.</BannerFootnote></BannerText></BannerTextContainer><BannerImageContainer><BannerImage><FluidImage src="/example-images/16x9-2.webp" alt="Placeholder" /></BannerImage></BannerImageContainer></Banner></DoubleBanner>
<div class="swan-double-banner"><divclass="swan-banner swan-banner-full-width-image swan-banner-text-box-horizontal-align-left"><div class="swan-banner-text-container"><div class="swan-banner-text"><p class="swan-banner-eyebrow">Optional eyebrow</p><p class="swan-banner-title">Title line with a message</p><div class="swan-banner-description"><p>Description to give a better idea of what is presented on thebanner.</p></div><p class="swan-banner-price">$123.45</p><div class="swan-banner-links"><buttontype="button"class="swan-button swan-button-skin-primary swan-button-mini">Mini</button></div><p class="swan-banner-footnote">An optional footnote can go below the button.</p></div></div><div class="swan-banner-image-container"><div class="swan-banner-image"><imgsrc="https://www.picsum.photos/800/300?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div></div><divclass="swan-banner swan-banner-full-width-image swan-banner-text-box-horizontal-align-left"><div class="swan-banner-text-container"><div class="swan-banner-text"><p class="swan-banner-eyebrow">Optional eyebrow</p><p class="swan-banner-display">30% off</p><p class="swan-banner-subtitle">Subtitle line with a message</p><div class="swan-banner-description"><p>Description to give a better idea of what is presented on thebanner.</p></div><p class="swan-banner-price">$123.45</p><div class="swan-banner-links"><buttontype="button"class="swan-button swan-button-skin-primary swan-button-mini">Mini</button></div><p class="swan-banner-footnote">An optional footnote can go below the button.</p></div></div><div class="swan-banner-image-container"><div class="swan-banner-image"><imgsrc="https://www.picsum.photos/800/300?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div></div></div>
Editorial (Holiday)
Use editorial
for storytelling moments, consumer-driven marketing moments, and for Holiday-related campaigns. This prop modifies BannerTitle
and BannerDisplay
to use Tiempos, per Brand guidelines.
Use this prop sparsely - most banners should not be editorial themed.
The preview has been updated.
<Bannerstyle={{'--swan-public-marketing-background':'#ede3cf' /* holiday-beige-1 from @vp/marketing-colors */,}}editorial><BannerTextContainer><BannerText><BannerEyebrow>Optional eyebrow</BannerEyebrow><BannerTitle>Title line with a message</BannerTitle><BannerDescription><p>Description to give a better idea of what is presented on the banner.</p></BannerDescription><BannerLinks><Button skin="primary">Button</Button></BannerLinks></BannerText></BannerTextContainer><BannerImageContainer><BannerImage><FluidImage src="/example-images/16x9.webp" alt="Placeholder" /></BannerImage></BannerImageContainer></Banner>
<divclass="swan-banner swan-banner-card swan-bgc-holiday-beige-1 swan-banner-editorial"><div class="swan-banner-text-container"><div class="swan-banner-text"><p class="swan-banner-eyebrow">Optional eyebrow</p><p class="swan-banner-title swan-font-secondary swan-font-weight-normal">Title line with a message</p><div class="swan-banner-description"><p>Description to give a better idea of what is presented on the banner.</p></div><div class="swan-banner-links"><button type="button" class="swan-button swan-button-skin-primary">Button</button></div></div></div><div class="swan-banner-image-container"><div class="swan-banner-image"><imgsrc="https://www.picsum.photos/800/300?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div></div>
Banner as Link
In the React API, use render
for a whole Banner with the behaviour of a Link.
In the Vanilla API, use an a
tag for the Banner.
The preview has been updated.
<Bannerrender={props => (<Link to="#elsewhere" className={props.className}>{props.children}</Link>)}><BannerTextContainer><BannerText><BannerTitle>Clickable Banner</BannerTitle><BannerDescription><p>This entire Banner's is a link, so it's clickable.</p></BannerDescription><BannerPrice>$123.45</BannerPrice><BannerLinks><Button skin="primary">Button</Button></BannerLinks><BannerFootnote>An optional footnote can go below the button.</BannerFootnote></BannerText></BannerTextContainer><BannerImageContainer><BannerImage><FluidImage src="/example-images/16x9.webp" alt="Placeholder" /></BannerImage></BannerImageContainer></Banner>
<aclass="swan-banner swan-banner-card swan-banner-text-box-horizontal-align-left swan-link"href="#elsewhere"><div class="swan-banner-text-container"><div class="swan-banner-text"><p class="swan-banner-title">Clickable Banner</p><div class="swan-banner-description"><p>This entire Banner's is a link, so it's clickable.</p></div><p class="swan-banner-price">$123.45</p><div class="swan-banner-links"><button type="button" class="swan-button swan-button-skin-primary">Button</button></div><p class="swan-banner-footnote">An optional footnote can go below the button.</p></div></div><div class="swan-banner-image-container"><div class="swan-banner-image"><imgsrc="https://www.picsum.photos/800/300?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div></a>
Height
Use height="short"
to reduce the spacing and minimum height of the Banner.
The preview has been updated.
<Banner variant="card" height="short"><BannerTextContainer><BannerText><BannerTitle>Title line with a message</BannerTitle><BannerDescription><p>Description to give a better idea of what is presented on the banner.</p></BannerDescription><BannerLinks><Button skin="primary">Button</Button></BannerLinks></BannerText></BannerTextContainer><BannerImageContainer><BannerImage><FluidImage src="/example-images/16x9.webp" alt="Placeholder" /></BannerImage></BannerImageContainer></Banner>
<divclass="swan-banner swan-banner-card swan-banner-text-box-horizontal-align-left swan-banner-short"><div class="swan-banner-text-container"><div class="swan-banner-text"><p class="swan-banner-title">Title line with a message</p><div class="swan-banner-description"><p>Description to give a better idea of what is presented on the banner.</p></div><div class="swan-banner-links"><button type="button" class="swan-button swan-button-skin-primary">Button</button></div></div></div><div class="swan-banner-image-container"><div class="swan-banner-image"><imgsrc="https://www.picsum.photos/800/300?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div></div>
Background color
Use bgc
or backgroundColor
to set the background color of the Banner.
Use darkMode
to use dark mode settings on darker colors.
For the full-with-image
variant, the React API version applies the same color to the background of the text box that floats over the image.
For the Vanilla API, use the same background color for both the Banner and the Banner Text sub-component.
The preview has been updated.
<Banner bgc="standard" darkMode><BannerTextContainer><BannerText><BannerEyebrow>Optional eyebrow</BannerEyebrow><BannerTitle>Title line with a message</BannerTitle><BannerDescription><p>Description to give a better idea of what is presented on the banner.</p></BannerDescription><BannerLinks><Button skin="primary">Button</Button></BannerLinks></BannerText></BannerTextContainer><BannerImageContainer><BannerImage><FluidImage src="/example-images/16x9.webp" alt="Placeholder" /></BannerImage></BannerImageContainer></Banner>
<div class="swan-banner swan-banner-card swan-bgc-standard swan-dark-mode"><div class="swan-banner-text-container"><div class="swan-banner-text swan-bgc-standard"><p class="swan-banner-eyebrow">Optional eyebrow</p><p class="swan-banner-title">Title line with a message</p><div class="swan-banner-description"><p>Description to give a better idea of what is presented on the banner.</p></div><div class="swan-banner-links"><button type="button" class="swan-button swan-button-skin-primary">Button</button></div></div></div><div class="swan-banner-image-container"><div class="swan-banner-image"><imgsrc="https://www.picsum.photos/800/300?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div></div>
For CMS-driven pages, the old rainbow palette of color options has been replaced by the @vp/marketing-colors
library. That library exports a broader color palette specifically intended for use in Banners on upper-funnel CMS-drive pages.
You can set the background colour by retrieving the desired color's HEX code from the library's MARKETING_COLORS
object. Apply the retrieved HEX code to the --swan-public-marketing-background CSS custom property. The object also exposes a darkMode
boolean.
import { MARKETING_COLORS } from '@vp/marketing-colors';<Bannerstyle={{'--swan-public-marketing-background': MARKETING_COLORS[selectedColor].code,}}darkMode={MARKETING_COLORS[selectedColor].mode.dark}>{/* Banner content */}</Banner>
Image
Use FluidImage
instead of ResponsiveImage
.
Alternatively, use a picture
tag, where the fallback image inside is a FluidImage
.
Image focal point
imageFocalPoint
on Banner
is deprecated in SWAN v3.7
Use imageFocalPoint
on the BannerImage
or BannerSecondaryImage
subcomponent instead.
use imageFocalPoint
to adjust the focus of a banner's image when it clips. This can be applied in both the BannerImage
and BannerSecondaryImage
subcomponent. This prop takes two values (the default is imageFocalPoint="center center"
) and is consistent across breakpoints:
- X-axis:
left
,center
, orright
. - Y-axis:
top
,center
, orbottom
.
The preview has been updated.
<Banner><BannerTextContainer><BannerText><BannerTitle>Left Top</BannerTitle><BannerDescription><p>This Banner is setting the image focal point to "right bottom".</p></BannerDescription><BannerLinks><Button skin="primary">Button</Button></BannerLinks></BannerText></BannerTextContainer><BannerImageContainer><BannerImage imageFocalPoint="right bottom"><FluidImage src="/example-images/16x9.webp" alt="Placeholder" /></BannerImage></BannerImageContainer></Banner>
<divclass="swan-banner swan-banner-card swan-banner-text-box-horizontal-align-left swan-banner-image-focal-point-right-bottom"><div class="swan-banner-text-container"><div class="swan-banner-text"><p class="swan-banner-title">Left Top</p><div class="swan-banner-description"><p>This Banner is setting the image focal point to "right bottom".</p></div><div class="swan-banner-links"><button type="button" class="swan-button swan-button-skin-primary">Button</button></div></div></div><div class="swan-banner-image-container"><div class="swan-banner-image"><imgsrc="https://www.picsum.photos/800/300?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div></div>
Video
Use video
to replace the img
or picture
tag.
In the React API, use video loop playsInline autoPlay
to configure a video to loop, play inline, and autoplay.
Small and Extra-Small screens
Text horizontal alignment
textHorizontalAlignOnExtraSmall
is deprecated in SWAN v3.3
The text will be by default center aligned on extra small screen size devices and to maintain the consistent user experience, we are removing this prop.
Use textHorizontalAlignOnExtraSmall="center"
to center align the text on Extra-Small screens.
The preview has been updated.
<Banner variant="card" textHorizontalAlignOnExtraSmall="center"><BannerTextContainer><BannerText><BannerTitle>Title line with a message</BannerTitle><BannerDescription><p>Description to give a better idea of what is presented on the banner.</p></BannerDescription><BannerLinks><Button skin="primary">Button</Button></BannerLinks></BannerText></BannerTextContainer><BannerImageContainer><BannerImage><FluidImage src="/example-images/16x9.webp" alt="Placeholder" /></BannerImage></BannerImageContainer></Banner>
<divclass="swan-banner swan-banner-card swan-banner-text-horizontal-align-on-extra-small-center"><div class="swan-banner-text-container"><div class="swan-banner-text"><p class="swan-banner-title">Title line with a message</p><div class="swan-banner-description"><p>Description to give a better idea of what is presented on the banner.</p></div><div class="swan-banner-links"><button type="button" class="swan-button swan-button-skin-primary">Button</button></div></div></div><div class="swan-banner-image-container"><div class="swan-banner-image"><imgsrc="https://www.picsum.photos/800/300?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div></div>
Hide image
Use hideImageOnExtraSmall
to hide the image on Extra-Small screens.
The preview has been updated.
<Banner variant="card" hideImageOnExtraSmall><BannerTextContainer><BannerText><BannerEyebrow>Optional eyebrow</BannerEyebrow><BannerTitle>Title line with a message</BannerTitle><BannerDescription><p>Description to give a better idea of what is presented on the banner.</p></BannerDescription><BannerPrice>$123.45</BannerPrice><BannerLinks><Button skin="primary">Button</Button></BannerLinks><BannerFootnote>An optional footnote can go below the button.</BannerFootnote></BannerText></BannerTextContainer><BannerImageContainer><BannerImage><FluidImage src="/example-images/16x9.webp" alt="Placeholder" /></BannerImage></BannerImageContainer></Banner>
<divclass="swan-banner swan-banner-card swan-banner-text-box-horizontal-align-left swan-banner-hide-image-on-extra-small"><div class="swan-banner-text-container"><div class="swan-banner-text"><p class="swan-banner-eyebrow">Optional eyebrow</p><p class="swan-banner-title">Title line with a message</p><div class="swan-banner-description"><p>Description to give a better idea of what is presented on the banner.</p></div><p class="swan-banner-price">$123.45</p><div class="swan-banner-links"><button type="button" class="swan-button swan-button-skin-primary">Button</button></div><p class="swan-banner-footnote">An optional footnote can go below the button.</p></div></div><div class="swan-banner-image-container"><div class="swan-banner-image"><imgsrc="https://www.picsum.photos/800/300?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div></div>
Hide one Banner inside a Double Banner
Use hideFirstBannerBelowMedium
to hide the first (left) banner on Small and Extra-Small screens.
Use hideSecondBannerBelowMedium
to hide the second (right) banner on Small and Extra-Small screens.
The preview has been updated.
<DoubleBanner hideFirstBannerBelowMedium><Banner variant="full-width-image"><BannerTextContainer><BannerText><BannerEyebrow>Optional eyebrow</BannerEyebrow><BannerDisplay>30% off</BannerDisplay><BannerTitle>Title line with a message</BannerTitle><BannerDescription><p>Description to give a better idea of what is presented on thebanner.</p></BannerDescription><BannerPrice>$123.45</BannerPrice><BannerLinks><Button skin="primary" size="mini">Mini</Button></BannerLinks><BannerFootnote>An optional footnote can go below the button.</BannerFootnote></BannerText></BannerTextContainer><BannerImageContainer><BannerImage><FluidImage src="/example-images/16x9-1.webp" alt="Placeholder" /></BannerImage></BannerImageContainer></Banner><Banner variant="full-width-image"><BannerTextContainer><BannerText><BannerEyebrow>optional Eyebrow</BannerEyebrow><BannerDisplay>30% off</BannerDisplay><BannerSubtitle>Subtitle line with a message</BannerSubtitle><BannerDescription><p>Description to give a better idea of what is presented on thebanner.</p></BannerDescription><BannerPrice>$123.45</BannerPrice><BannerLinks><Button skin="primary" size="mini">Mini</Button></BannerLinks><BannerFootnote>An optional footnote can go below the button.</BannerFootnote></BannerText></BannerTextContainer><BannerImageContainer><BannerImage><FluidImage src="/example-images/16x9-2.webp" alt="Placeholder" /></BannerImage></BannerImageContainer></Banner></DoubleBanner>
<divclass="swan-double-banner swan-double-banner-hide-first-banner-below-medium"><divclass="swan-banner swan-banner-full-width-image swan-banner-text-box-horizontal-align-left"><div class="swan-banner-text-container"><div class="swan-banner-text"><p class="swan-banner-eyebrow">Optional eyebrow</p><p class="swan-banner-display">30% off</p><p class="swan-banner-title">Title line with a message</p><div class="swan-banner-description"><p>Description to give a better idea of what is presented on thebanner.</p></div><p class="swan-banner-price">$123.45</p><div class="swan-banner-links"><buttontype="button"class="swan-button swan-button-skin-primary swan-button-mini">Mini</button></div><p class="swan-banner-footnote">An optional footnote can go below the button.</p></div></div><div class="swan-banner-image-container"><div class="swan-banner-image"><imgsrc="https://www.picsum.photos/800/300?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div></div><divclass="swan-banner swan-banner-full-width-image swan-banner-text-box-horizontal-align-left"><div class="swan-banner-text-container"><div class="swan-banner-text"><p class="swan-banner-eyebrow">optional Eyebrow</p><p class="swan-banner-display">30% off</p><p class="swan-banner-subtitle">Subtitle line with a message</p><div class="swan-banner-description"><p>Description to give a better idea of what is presented on thebanner.</p></div><p class="swan-banner-price">$123.45</p><div class="swan-banner-links"><buttontype="button"class="swan-button swan-button-skin-primary swan-button-mini">Mini</button></div><p class="swan-banner-footnote">An optional footnote can go below the button.</p></div></div><div class="swan-banner-image-container"><div class="swan-banner-image"><imgsrc="https://www.picsum.photos/800/300?id=right"alt="Placeholder"class="swan-fluid-image"/></div></div></div></div>
Accessibility
In the React API, BannerTitle defaults to a <p>
tag. Use structural headings tags from <h1>
through <h6>
accordingly to the page structure.
Ensure every Banner image has an alt
attribute.
Use the appropriate mode to ensure color contrast.