BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/weekendsuperhero-io/sistine/carousel

Carousel

weekendsuperhero-io-sistine/carousel
FreeComponent

An items-driven carousel, with the glass material system — pass slides as children (no compound CarouselContent/Item/Next/Previous/API parts).

Install it

npx shadcn@latest add https://raw.githubusercontent.com/Weekendsuperhero-io/sistine/main/public/r/carousel.json

Source

components/ui/carousel.tsxraw.githubusercontent.com/Weekendsuperhero-io/sistine/main/public/r/carousel.json
1"use client";
2
3import { CaretLeftIcon, CaretRightIcon } from "@phosphor-icons/react";
4import { cva, type VariantProps } from "class-variance-authority";
5import * as React from "react";
6import { type HoverEffect, hoverEffects } from "@/lib/hover-effects";
7import { type MaterialAxisProps, materialSurface, splitAxisProps } from "@/lib/material";
8import { cn } from "@/lib/utils";
9import { Button } from "./button";
10
11/* Variant classes carry BEHAVIOR only; the surface comes from materialSurface. */
12const carouselVariants = cva("", {
13 variants: {
14 variant: {
15 default: "bg-card text-card-foreground border shadow-sm",
16 glass: "text-foreground",
17 },
18 },
19 defaultVariants: {
20 variant: "glass",
21 },
22});
23
24/* Role: borderless adaptive glass. */
25const ROLE = {};
26
27export interface CarouselProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof carouselVariants>, MaterialAxisProps {
28 effect?: HoverEffect;
29 autoPlay?: boolean;
30 interval?: number;
31}
32
33const Carousel = React.forwardRef<HTMLDivElement, CarouselProps>(
34 ({ className, variant = "glass", effect, autoPlay = false, interval = 3000, children, ...props }, ref) => {
35 const [axes, rest] = splitAxisProps(props);
36 const [currentIndex, setCurrentIndex] = React.useState(0);
37 const items = React.Children.toArray(children);
38 const totalItems = items.length;
39
40 React.useEffect(() => {
41 if (!autoPlay || totalItems <= 1) return;
42
43 const timer = setInterval(() => {
44 setCurrentIndex((prev) => (prev + 1) % totalItems);
45 }, interval);
46
47 return () => clearInterval(timer);
48 }, [
49 autoPlay,
50 interval,
51 totalItems,
52 ]);
53
54 const goToSlide = (index: number) => {
55 setCurrentIndex(index);
56 };
57
58 const goToPrevious = () => {
59 setCurrentIndex((prev) => (prev - 1 + totalItems) % totalItems);
60 };
61
62 const goToNext = () => {
63 setCurrentIndex((prev) => (prev + 1) % totalItems);
64 };
65
66 const m = materialSurface(variant === "default" ? null : ROLE, axes);
67
68 if (totalItems === 0) return null;
69
70 return (
71 <div
72 ref={ref}
73 data-material={m?.["data-material"]}
74 className={cn(
75 m?.className,
76 "relative w-full overflow-hidden rounded-lg",
77 carouselVariants({
78 variant,
79 }),
80 effect &&
81 hoverEffects({
82 hover: effect,
83 }),
84 className,
85 )}
86 {...rest}
87 >
88 <div
89// … truncated

What it pulls in

npm packages

  • @phosphor-icons/react
  • class-variance-authority
  • clsx
  • tailwind-merge

Other registry items

  • @sistine/button
  • @sistine/theme

Files it writes

  • lib/utils.ts
  • lib/material.ts
  • lib/hover-effects.ts
  • components/ui/carousel.tsx

Facts

Registry
weekendsuperhero-io/sistine
Type
registry:component
Access
Free
Files written
4
Licence
MIT
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

weekendsuperhero.io Weekendsuperhero-io/sistine on GitHub Raw registry item This item as JSON

More from weekendsuperhero-io/sistine

All 71 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionweekendsuperhero-io/sistineComponentsFree5 deps · 4 files
Alertalertweekendsuperhero-io/sistineComponentsFree3 deps · 4 files
Alert Dialogalert-dialogweekendsuperhero-io/sistineComponentsFree4 deps · 4 files
Auto Foregroundauto-foregroundweekendsuperhero-io/sistineComponentsFreeno deps
Avataravatarweekendsuperhero-io/sistineComponentsFree4 deps · 4 files
Badgebadgeweekendsuperhero-io/sistineComponentsFree4 deps · 4 files
Breadcrumbbreadcrumbweekendsuperhero-io/sistineComponentsFree5 deps · 4 files
Buttonbuttonweekendsuperhero-io/sistineComponentsFree4 deps · 4 files
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex