MCPcopy
hub / github.com/untitleduico/react / useCarousel

Function useCarousel

components/application/carousel/carousel-base.tsx:45–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43export const CarouselContext = createContext<CarouselContextProps | null>(null);
44
45export const useCarousel = () => {
46 const context = useContext(CarouselContext);
47
48 if (!context) {
49 throw new Error("The `useCarousel` hook must be used within a <Carousel />");
50 }
51
52 return context;
53};
54
55const CarouselRoot = ({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }: ComponentPropsWithRef<"div"> & CarouselProps) => {
56 const [carouselRef, api] = useEmblaCarousel(

Callers 5

CarouselIndicatorFunction · 0.90
CarouselContentFunction · 0.85
TriggerFunction · 0.85
CarouselIndicatorFunction · 0.85
CarouselIndicatorGroupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected