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
  d24fb11b_d80e_07a7_4f78_56e305561ec0["CarouselPrevious()"]
  7e7652ce_fc95_8d6e_4506_c860f14d1d73["carousel.tsx"]
  d24fb11b_d80e_07a7_4f78_56e305561ec0 -->|defined in| 7e7652ce_fc95_8d6e_4506_c860f14d1d73
  0f21d8da_a9b4_9bf1_b6da_e8ba979e307c["useCarousel()"]
  d24fb11b_d80e_07a7_4f78_56e305561ec0 -->|calls| 0f21d8da_a9b4_9bf1_b6da_e8ba979e307c
  style d24fb11b_d80e_07a7_4f78_56e305561ec0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/radix/ui-rtl/carousel.tsx lines 173–201

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

  return (
    <Button
      data-slot="carousel-previous"
      variant={variant}
      size={size}
      className={cn(
        "absolute touch-manipulation rounded-full",
        orientation === "horizontal"
          ? "-start-12 top-1/2 -translate-y-1/2"
          : "start-1/2 -top-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2",
        className
      )}
      disabled={!canScrollPrev}
      onClick={scrollPrev}
      {...props}
    >
      <ChevronLeftIcon className="rtl:rotate-180" />
      <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/examples/radix/ui-rtl/carousel.tsx.
Where is CarouselPrevious() defined?
CarouselPrevious() is defined in apps/v4/examples/radix/ui-rtl/carousel.tsx at line 173.
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