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
  4b187350_c091_fe85_8402_218c4f3097d5["CarouselPrevious()"]
  736f7ee1_27b9_e9b5_e0f3_5ccbcfe0a0bf["carousel.tsx"]
  4b187350_c091_fe85_8402_218c4f3097d5 -->|defined in| 736f7ee1_27b9_e9b5_e0f3_5ccbcfe0a0bf
  3ebf1774_ea9c_1355_c14f_91d89aa72384["useCarousel()"]
  4b187350_c091_fe85_8402_218c4f3097d5 -->|calls| 3ebf1774_ea9c_1355_c14f_91d89aa72384
  style 4b187350_c091_fe85_8402_218c4f3097d5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/registry/bases/base/ui/carousel.tsx lines 174–209

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(
        "cn-carousel-previous absolute touch-manipulation",
        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}
    >
      <IconPlaceholder
        lucide="ChevronLeftIcon"
        tabler="IconChevronLeft"
        hugeicons="ArrowLeft01Icon"
        phosphor="CaretLeftIcon"
        remixicon="RiArrowLeftSLine"
        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/registry/bases/base/ui/carousel.tsx.
Where is CarouselPrevious() defined?
CarouselPrevious() is defined in apps/v4/registry/bases/base/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