TidalUI

Carousel preview

A controlled, non-autoplaying carousel with persistent consumer-owned slides, native navigation controls, direct selection, keyboard mov…

pro · Navigation · composite

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add @tidal-pro/carousel

Import components/ui/tidal.css, components/ui/carousel.css. Wrap installed components in tidal-scope.

Preview

Carousel component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/carousel.css";
import{TidalCarousel}from"./components/ui/carousel";
export default()=><div className="tidal-scope"><TidalCarousel currentSlideId={"example"} label={"Demo"} onCurrentSlideChange={() => {}} slides={[{id:"example",label:"Demo",content:"value"}]}/></div>;

API and props

TidalCarousel.currentSlideId (required)
string

Required current slide id value accepted by this exported component.

TidalCarousel.label (required)
string

Required label value accepted by this exported component.

TidalCarousel.onCurrentSlideChange (required)
(slideId: string, event: TidalCarouselChangeEvent, source: TidalCarouselChangeSource) => void

Callback invoked when the current slide change interaction is proposed.

TidalCarousel.slides (required)
ReadonlyArray<TidalCarouselSlide>

Required slides value accepted by this exported component.

TidalCarousel.disabled
boolean | undefined

Optional disabled value accepted by this exported component.

TidalCarousel.emptyMessage
ReactNode

Optional empty message value accepted by this exported component.

TidalCarousel.labels
Partial<TidalCarouselLabels> | undefined

Optional labels value accepted by this exported component.

TidalCarousel.loop
boolean | undefined

Optional loop value accepted by this exported component.

TidalCarousel.nextButtonProps
Omit<ButtonHTMLAttributes<HTMLButtonElement>, "disabled" | "type" | "aria-disabled" | "aria-label" | "children"> | undefined

Optional next button props value accepted by this exported component.

TidalCarousel.nextButtonRef
Ref<HTMLButtonElement> | undefined

Optional next button ref value accepted by this exported component.

TidalCarousel.previousButtonProps
Omit<ButtonHTMLAttributes<HTMLButtonElement>, "disabled" | "type" | "aria-disabled" | "aria-label" | "children"> | undefined

Optional previous button props value accepted by this exported component.

TidalCarousel.previousButtonRef
Ref<HTMLButtonElement> | undefined

Optional previous button ref value accepted by this exported component.

TidalCarousel.showDirectControls
boolean | undefined

Optional show direct controls value accepted by this exported component.

TidalCarousel.viewportProps
Omit<HTMLAttributes<HTMLDivElement>, "tabIndex" | "role" | "aria-label" | "aria-roledescription" | "children"> | undefined

Optional viewport props value accepted by this exported component.

TidalCarousel.viewportRef
Ref<HTMLDivElement> | undefined

Optional viewport ref value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas