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
  623d88dc_6bc1_037f_e960_ef1d68d5a9f0["CarouselPrevious()"]
  afc3006a_a233_0ac7_934f_baf526af7bef["carousel.tsx"]
  623d88dc_6bc1_037f_e960_ef1d68d5a9f0 -->|defined in| afc3006a_a233_0ac7_934f_baf526af7bef
  1e31212d_a6d2_8c14_8588_c4256ad88c55["useCarousel()"]
  623d88dc_6bc1_037f_e960_ef1d68d5a9f0 -->|calls| 1e31212d_a6d2_8c14_8588_c4256ad88c55
  style 623d88dc_6bc1_037f_e960_ef1d68d5a9f0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/base/ui/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"
          ? "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}
    >
      <ChevronLeftIcon className="cn-rtl-flip" />
      <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/base/ui/carousel.tsx.
Where is CarouselPrevious() defined?
CarouselPrevious() is defined in apps/v4/examples/base/ui/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