Bonusway design system

Navigation

Carousel

A rotating banner — the home page promos. Auto-advances, pauses on hover and focus, and every label is a prop because this component predates the page being localized and must not ship English into eleven markets.

import Carousel from '@/components/ui/Carousel';

Source: src/components/ui/Carousel.tsx

Examples

Slides with indicators

Arrows are hidden below sm and swipe takes over: on a 98px-tall phone banner the arrows covered the content they were meant to reveal. Narrow the stage to 375px above and drag a slide to see it.

interactive
First promotion

Props

<Carousel> props

PropTypeDefaultDescription
slidesrequiredCarouselSlide[]——
autoPlayIntervalnumber5000—
aspectRatiostring'990 / 290'

Reserved width/height ratio (CSS aspect-ratio), so the page doesn't shift when the images arrive. Defaults to the live banner size, 990×290.

classNamestring''—
previousLabelstring'Previous slide'—
nextLabelstring'Next slide'—
slideLabelstring'Slide {n}'—
pauseLabelstring'Pause slide rotation'—
resumeLabelstring'Resume slide rotation'—

Accessibility

  • Auto-rotation pauses on hover and on focus, and there is an explicit pause control — an animation the user cannot stop is a WCAG failure.
  • Indicators are buttons labelled with their slide number via `slideLabel`, where `{n}` is substituted.

Usage

Do

  • Pass every label from your translations. The defaults are English and exist only so the component can be rendered in this catalog.
  • Set aspectRatio to the real banner ratio, so the space is reserved before the images load.

Don’t

  • Don’t put anything important on slide two or later. Most people see the first slide and nothing else.
  • Don’t use it as a layout for content that should all be visible.

Related:Tabs

Ta strona używa plików cookies

Używamy plików cookie, aby poprawić jakość użytkowania
oraz funkcjonowanie naszej strony i dostosować treści, których Ci dostarczamy. Niezbędne pliki cookie są konieczne do prawidłowego działania naszego serwisu. Jeśli wyrażasz zgodę na gromadzenie przez nas informacji o Tobie za pomocą niezbędnych i marketingowych plików cookie, kliknij „Zaakceptuj wszystko”. Zawsze możesz zmienić swoje preferencje, odwiedzając Ustawienia plików cookie.

Ustawienia cookies