Home / Function/ useCarousel() — ui Function Reference

useCarousel() — ui Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  0f21d8da_a9b4_9bf1_b6da_e8ba979e307c["useCarousel()"]
  7e7652ce_fc95_8d6e_4506_c860f14d1d73["carousel.tsx"]
  0f21d8da_a9b4_9bf1_b6da_e8ba979e307c -->|defined in| 7e7652ce_fc95_8d6e_4506_c860f14d1d73
  2826f641_ef6b_a9f2_70bf_b8c818db942b["CarouselContent()"]
  2826f641_ef6b_a9f2_70bf_b8c818db942b -->|calls| 0f21d8da_a9b4_9bf1_b6da_e8ba979e307c
  bdc6209b_73ce_3158_c901_d7910dd4afdf["CarouselItem()"]
  bdc6209b_73ce_3158_c901_d7910dd4afdf -->|calls| 0f21d8da_a9b4_9bf1_b6da_e8ba979e307c
  d24fb11b_d80e_07a7_4f78_56e305561ec0["CarouselPrevious()"]
  d24fb11b_d80e_07a7_4f78_56e305561ec0 -->|calls| 0f21d8da_a9b4_9bf1_b6da_e8ba979e307c
  571bbe00_8d1b_4068_3322_e79684d183dc["CarouselNext()"]
  571bbe00_8d1b_4068_3322_e79684d183dc -->|calls| 0f21d8da_a9b4_9bf1_b6da_e8ba979e307c
  style 0f21d8da_a9b4_9bf1_b6da_e8ba979e307c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/radix/ui-rtl/carousel.tsx lines 34–42

function useCarousel() {
  const context = React.useContext(CarouselContext)

  if (!context) {
    throw new Error("useCarousel must be used within a <Carousel />")
  }

  return context
}

Subdomains

Frequently Asked Questions

What does useCarousel() do?
useCarousel() is a function in the ui codebase, defined in apps/v4/examples/radix/ui-rtl/carousel.tsx.
Where is useCarousel() defined?
useCarousel() is defined in apps/v4/examples/radix/ui-rtl/carousel.tsx at line 34.
What calls useCarousel()?
useCarousel() is called by 4 function(s): CarouselContent, CarouselItem, CarouselNext, CarouselPrevious.

Analyze Your Own Codebase

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

Try Supermodel Free