Skip to content

Carousel

The Carousel cycles through slides with touch / swipe support. Use variant="default" for image + copy cards, form for custom slide bodies (and an optional footer strip in the form layout), and auth for full-bleed marketing slides on authentication-style layouts.

Loading Code Block...

Slides are driven by items: each entry includes backgroundImage, badgeText, optional badgeTheme, title, subtext, and optional link.

When height is omitted, both packages call extractHeightClasses to pick a responsive default. The defaults currently differ between frameworks:

  • React: h-[579px] desktop, h-[374px] mobile.
  • Vue: h-[400px] lg:h-[500px] desktop, h-[300px] mobile.

Pass an explicit height like "h-[420px] md:h-[520px]" if you need cross-framework parity.

autoSlide defaults to true. Set autoSlide={false} (React) or :autoSlide="false" (Vue) to pause automatic advancement. Tune the delay with autoSlideInterval (milliseconds, default 5000).

Pass carouselItems: an array of objects with slot and optional backgroundColor.

width defaults to 459px in the form layout; className adds classes on the outer wrapper. The footer strip beneath the slides (copyright + social links) is toggled with showFooter (default true) — set it to false to hide it. The form variant is desktop-only (hidden md:flex) in both frameworks.

Loading Code Block...

Use className for backdrop styling (e.g. bg-blue-900).

What's New?

How you access your activities on Hubtel has been improved with a refreshed new look!... Learn more

Big Update: Your Merchant Portal is Now Mobile-Friendly and Better Organized

We've reorganised the side navigation menu to reduce clutter. You can now access all money functions from a single menu

Learn more
Loading Code Block...

This iframe shows a full-height auth carousel layout with auto-sliding enabled, as used on the design system site (e.g. alongside login templates).

Loading Code Block...

PropsDefaultTypeDescription
variant'default''default' | 'form' | 'auth'Which carousel implementation to render.
className-stringExtra classes on the outer wrapper (both frameworks).
autoSlidetruebooleanAdvance slides automatically when applicable.
autoSlideInterval5000numberDelay between automatic slides (ms).
heightReact: `h-[579px]` (desktop) / `h-[374px]` (mobile); Vue: `h-[400px] lg:h-[500px]` (desktop) / `h-[300px]` (mobile)stringResponsive Tailwind height utilities for the default variant. Parsed by `extractHeightClasses`. Defaults differ by framework — pass an explicit value for parity.
width'459px' (form variant)stringWidth of the form carousel container; also used where the form layout reads `width`.
items[]CarouselItem[]Slides for `variant="default"` (see Default variant).
carouselItems-Array<{ slot, backgroundColor?: string }>Slides for `variant="form"`. `slot` is a `React.ReactNode` in React and a component definition (consumed by `<component :is>`) in Vue.
showFootertruebooleanToggles the copyright + socials footer beneath `variant="form"` slides.
slots-React: `React.ReactNode[]`; Vue: `unknown[]` (rendered via `<component :is>`)Slides for `variant="auth"`. React accepts pre-rendered nodes; Vue expects component definitions (e.g. from `defineComponent`).
PropsDefaultTypeDescription
backgroundImage-stringBackground image URL.
badgeText-stringBadge label.
badgeTheme-stringOptional Tailwind classes for the badge (e.g. `bg-red-600 text-white`).
title-stringHeadline.
subtext-stringSupporting line (date, read time, etc.).
link-stringOptional destination when the slide is clickable.
  • Provide meaningful alt text for images inside form/auth slides.
  • When auto-advance is on, ensure content is still readable within autoSlideInterval; pause on hover is handled in the implementation—verify for your content length.
  • Use the iframe demos only as visual references; embed the component directly in apps for full keyboard and screen-reader control.