Home / Function/ CarouselNext() — ui Function Reference

CarouselNext() — ui Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  b9496d7c_6acd_d399_76ed_5c17178c4cd8["CarouselNext()"]
  afc3006a_a233_0ac7_934f_baf526af7bef["carousel.tsx"]
  b9496d7c_6acd_d399_76ed_5c17178c4cd8 -->|defined in| afc3006a_a233_0ac7_934f_baf526af7bef
  1e31212d_a6d2_8c14_8588_c4256ad88c55["useCarousel()"]
  b9496d7c_6acd_d399_76ed_5c17178c4cd8 -->|calls| 1e31212d_a6d2_8c14_8588_c4256ad88c55
  style b9496d7c_6acd_d399_76ed_5c17178c4cd8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/base/ui/carousel.tsx lines 203–231

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

  return (
    <Button
      data-slot="carousel-next"
      variant={variant}
      size={size}
      className={cn(
        "absolute touch-manipulation rounded-full",
        orientation === "horizontal"
          ? "top-1/2 -right-12 -translate-y-1/2"
          : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
        className
      )}
      disabled={!canScrollNext}
      onClick={scrollNext}
      {...props}
    >
      <ChevronRightIcon className="cn-rtl-flip" />
      <span className="sr-only">Next slide</span>
    </Button>
  )
}

Subdomains

Frequently Asked Questions

What does CarouselNext() do?
CarouselNext() is a function in the ui codebase, defined in apps/v4/examples/base/ui/carousel.tsx.
Where is CarouselNext() defined?
CarouselNext() is defined in apps/v4/examples/base/ui/carousel.tsx at line 203.
What does CarouselNext() call?
CarouselNext() 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