Skip to main content

Promo Carousel

A PromoCarousel is built using the same base components as the Carousel. It has a slimmer look and includes autoplay and slide transition options. This carousel uses the PromoText component for its slides.

The component can be added to a page from within the CMS. When assigned to a Block and given the handle (__promo-carousel) it is rendered globally above the site header.

Example

10% off Best Sellers. Discount applied in checkout.

Free standard shipping when you spend over $50.00. Restrictions apply.

New arrivals just landed! SHOP NOW

Variants

Use theicon above to preview
VariantDescriptionValues
contentArray of carousel content
  • PromoText blocks
backgroundColorEnum of theme background colors
  • background
  • primary
  • secondary
  • accent
  • muted
  • destructive
autoplayOption to have the carousel automatically advance on initialization
  • true
  • false
transitionSlide transition style
  • slideIn
  • fade

Customization

The approach for customization will vary depending on if the customization is intended to be global for all consumers of the UI component or if it is only an override for a particular instance.

  • If the customization is necessary for all use cases, update the component source code in the UI library package directly.
  • Otherwise, pass className overrides. Class overrides can be applied to all sub-components.

Promo Text Example

The PromoText component is used within the PromoCarousel component. It uses the same hv-ui parts in the Text component, but is a simplified version with Promo Carousel-specific classes applied.

import { TextWrapper, TextContent, TextBody, Text } from '@hv/ui/text';

<TextWrapper className='mx-auto h-full md:max-w-[80vw] lg:max-w-[60vw]'>
<TextContent className='h-full content-center p-3'>
<TextBody className='pe-12 text-center md:pe-0'>
<Text
text={`markdown text to display`}
type='promoText'
format='markdown'
/>
</TextBody>
</TextContent>
</TextWrapper>;