MCPcopy Create free account
hub / github.com/code-with-antonio/nodebase / CarouselPrevious

Function CarouselPrevious

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

Source from the content-addressed store, hash-verified

172}
173
174function CarouselPrevious({
175 className,
176 variant = "outline",
177 size = "icon",
178 ...props
179}: React.ComponentProps<typeof Button>) {
180 const { orientation, scrollPrev, canScrollPrev } = useCarousel()
181
182 return (
183 <Button
184 data-slot="carousel-previous"
185 variant={variant}
186 size={size}
187 className={cn(
188 "absolute size-8 rounded-full",
189 orientation === "horizontal"
190 ? "top-1/2 -left-12 -translate-y-1/2"
191 : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
192 className
193 )}
194 disabled={!canScrollPrev}
195 onClick={scrollPrev}
196 {...props}
197 >
198 <ArrowLeft />
199 <span className="sr-only">Previous slide</span>
200 </Button>
201 )
202}
203
204function CarouselNext({
205 className,

Callers

nothing calls this directly

Calls 2

cnFunction · 0.90
useCarouselFunction · 0.85

Tested by

no test coverage detected