Home / Function/ CarouselPrevious() — ui Function Reference

CarouselPrevious() — ui Function Reference

Architecture documentation for the CarouselPrevious() function in carousel.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  a4d67425_1cc8_79d4_99a2_7330bc8de931["CarouselPrevious()"]
  34ea8762_b6f9_1326_4ee4_e5f05e66390a["carousel.tsx"]
  a4d67425_1cc8_79d4_99a2_7330bc8de931 -->|defined in| 34ea8762_b6f9_1326_4ee4_e5f05e66390a
  16e3bfe9_3945_1248_4edb_97d104cf9a3e["useCarousel()"]
  a4d67425_1cc8_79d4_99a2_7330bc8de931 -->|calls| 16e3bfe9_3945_1248_4edb_97d104cf9a3e
  style a4d67425_1cc8_79d4_99a2_7330bc8de931 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/registry/new-york-v4/ui/carousel.tsx lines 174–202

function CarouselPrevious({
  className,
  variant = "outline",
  size = "icon",
  ...props
}: React.ComponentProps<typeof Button>) {
  const { orientation, scrollPrev, canScrollPrev } = useCarousel()

  return (
    <Button
      data-slot="carousel-previous"
      variant={variant}
      size={size}
      className={cn(
        "absolute size-8 rounded-full",
        orientation === "horizontal"
          ? "top-1/2 -left-12 -translate-y-1/2"
          : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
        className
      )}
      disabled={!canScrollPrev}
      onClick={scrollPrev}
      {...props}
    >
      <ArrowLeft />
      <span className="sr-only">Previous slide</span>
    </Button>
  )
}

Subdomains

Frequently Asked Questions

What does CarouselPrevious() do?
CarouselPrevious() is a function in the ui codebase, defined in apps/v4/registry/new-york-v4/ui/carousel.tsx.
Where is CarouselPrevious() defined?
CarouselPrevious() is defined in apps/v4/registry/new-york-v4/ui/carousel.tsx at line 174.
What does CarouselPrevious() call?
CarouselPrevious() calls 1 function(s): useCarousel.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free