MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / CarouselPrevious

Function CarouselPrevious

packages/react/src/components/carousel.tsx:163–191  ·  view source on GitHub ↗
({
  className,
  variant = "outline",
  size = "icon",
  ...props
}: React.ComponentProps<typeof Button>)

Source from the content-addressed store, hash-verified

161}
162
163function CarouselPrevious({
164 className,
165 variant = "outline",
166 size = "icon",
167 ...props
168}: React.ComponentProps<typeof Button>) {
169 const { orientation, scrollPrev, canScrollPrev } = useCarousel();
170
171 return (
172 <Button
173 data-slot="carousel-previous"
174 variant={variant}
175 size={size}
176 className={cn(
177 "absolute size-8 rounded-full",
178 orientation === "horizontal"
179 ? "top-1/2 -left-12 -translate-y-1/2"
180 : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
181 className,
182 )}
183 disabled={!canScrollPrev}
184 onClick={scrollPrev}
185 {...props}
186 >
187 <ArrowLeft />
188 <span className="sr-only">Previous slide</span>
189 </Button>
190 );
191}
192
193function CarouselNext({
194 className,

Callers

nothing calls this directly

Calls 2

cnFunction · 0.90
useCarouselFunction · 0.85

Tested by

no test coverage detected