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

Relationship Graph

Source Code

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