Home / File/ carousel-plugin.tsx — ui Source File

carousel-plugin.tsx — ui Source File

Architecture documentation for carousel-plugin.tsx, a tsx file in the ui codebase. 4 imports, 0 dependents.

File tsx ComponentRegistry ChartRegistry 4 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  98b62805_6a90_e1d7_dfe2_11de54138d56["carousel-plugin.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  98b62805_6a90_e1d7_dfe2_11de54138d56 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  be51ebeb_aca3_1b75_3747_8d00a4cb95b0["embla-carousel-autoplay"]
  98b62805_6a90_e1d7_dfe2_11de54138d56 --> be51ebeb_aca3_1b75_3747_8d00a4cb95b0
  40a08bc2_b80f_cbb3_c3f5_f3ceafbb7d31["card"]
  98b62805_6a90_e1d7_dfe2_11de54138d56 --> 40a08bc2_b80f_cbb3_c3f5_f3ceafbb7d31
  a17cbcca_02e7_d30c_215a_6a83a834b2cb["carousel"]
  98b62805_6a90_e1d7_dfe2_11de54138d56 --> a17cbcca_02e7_d30c_215a_6a83a834b2cb
  style 98b62805_6a90_e1d7_dfe2_11de54138d56 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import * as React from "react"
import Autoplay from "embla-carousel-autoplay"

import { Card, CardContent } from "@/registry/default/ui/card"
import {
  Carousel,
  CarouselContent,
  CarouselItem,
  CarouselNext,
  CarouselPrevious,
} from "@/registry/default/ui/carousel"

export default function CarouselPlugin() {
  const plugin = React.useRef(
    Autoplay({ delay: 2000, stopOnInteraction: true })
  )

  return (
    <Carousel
      plugins={[plugin.current]}
      className="w-full max-w-xs"
      onMouseEnter={plugin.current.stop}
      onMouseLeave={plugin.current.reset}
    >
      <CarouselContent>
        {Array.from({ length: 5 }).map((_, index) => (
          <CarouselItem key={index}>
            <div className="p-1">
              <Card>
                <CardContent className="flex aspect-square items-center justify-center p-6">
                  <span className="text-4xl font-semibold">{index + 1}</span>
                </CardContent>
              </Card>
            </div>
          </CarouselItem>
        ))}
      </CarouselContent>
      <CarouselPrevious />
      <CarouselNext />
    </Carousel>
  )
}

Subdomains

Functions

Dependencies

  • card
  • carousel
  • embla-carousel-autoplay
  • react

Frequently Asked Questions

What does carousel-plugin.tsx do?
carousel-plugin.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in carousel-plugin.tsx?
carousel-plugin.tsx defines 1 function(s): CarouselPlugin.
What does carousel-plugin.tsx depend on?
carousel-plugin.tsx imports 4 module(s): card, carousel, embla-carousel-autoplay, react.
Where is carousel-plugin.tsx in the architecture?
carousel-plugin.tsx is located at deprecated/www/registry/default/examples/carousel-plugin.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: deprecated/www/registry/default/examples).

Analyze Your Own Codebase

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

Try Supermodel Free