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
  cd98b01d_e8fb_3b38_f534_d0589b55de3b["useCarousel()"]
  60c085f4_a46a_b0b3_ed68_c0d706f24e67["carousel.tsx"]
  cd98b01d_e8fb_3b38_f534_d0589b55de3b -->|defined in| 60c085f4_a46a_b0b3_ed68_c0d706f24e67
  c6f8f27a_290a_4c97_9f6b_4b30116885b7["CarouselContent()"]
  c6f8f27a_290a_4c97_9f6b_4b30116885b7 -->|calls| cd98b01d_e8fb_3b38_f534_d0589b55de3b
  8070e831_d36e_9099_971a_d248cfc611a3["CarouselItem()"]
  8070e831_d36e_9099_971a_d248cfc611a3 -->|calls| cd98b01d_e8fb_3b38_f534_d0589b55de3b
  355982f0_70bd_8cb1_b879_a47f8d4aa15c["CarouselPrevious()"]
  355982f0_70bd_8cb1_b879_a47f8d4aa15c -->|calls| cd98b01d_e8fb_3b38_f534_d0589b55de3b
  ab40efd1_f80e_cec3_d91e_cdea3bd3f81f["CarouselNext()"]
  ab40efd1_f80e_cec3_d91e_cdea3bd3f81f -->|calls| cd98b01d_e8fb_3b38_f534_d0589b55de3b
  style cd98b01d_e8fb_3b38_f534_d0589b55de3b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/radix/ui/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/carousel.tsx.
Where is useCarousel() defined?
useCarousel() is defined in apps/v4/examples/radix/ui/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