card-deck
delta-components/card-deckFreeComponent
delta-components publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by delta-components on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://deltacomponents.dev/r/card-deck.jsonSource
1"use client"23import React from "react"4import { motion } from "framer-motion"5import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react"6import { Autoplay, EffectCards, Navigation, Pagination } from "swiper/modules"7import { Swiper, SwiperSlide } from "swiper/react"89import "swiper/css/effect-cards"10import "swiper/css/pagination"11import "swiper/css/navigation"12import "swiper/css"1314import { cn } from "@/lib/utils"1516interface CardDeckContainerProps {17 children: React.ReactNode18 className?: string19 showPagination?: boolean20 showNavigation?: boolean21 autoplay?: boolean22 spaceBetween?: number23 enableInitialAnimation?: boolean24}2526interface CardDeckItemProps {27 children: React.ReactNode28 className?: string29}3031// New modular API components32export function CardDeckContainer({33 children,34 className,35 showPagination = false,36 showNavigation = false,37 autoplay = false,38 spaceBetween = 40,39 enableInitialAnimation = true,40}: CardDeckContainerProps) {41 const css = `42 .card-deck {43 padding: 20px 0 50px 0 !important;44 }45 .card-deck .swiper-slide {46 overflow: visible !important;47 }48 .card-deck .swiper-slide-shadow-cards {49 border-radius: 1.5rem !important;50 }51 `5253 return (54 <motion.div55 initial={enableInitialAnimation ? { opacity: 0, translateY: 20 } : false}56 animate={enableInitialAnimation ? { opacity: 1, translateY: 0 } : false}57 transition={58 enableInitialAnimation59 ? {60 duration: 0.3,61 delay: 0.5,62 }63 : undefined64 }65 className={cn("relative w-full max-w-3xl overflow-visible", className)}66 >67 <style>{css}</style>6869 <Swiper70 spaceBetween={spaceBetween}71 autoplay={72 autoplay73 ? {74 delay: 1000,75 disableOnInteraction: false,76 }77 : false78 }79 effect="cards"80 grabCursor={true}81 loop={false}82 allowTouchMove={true}83 touchRatio={1}84 resistance={true}85 resistanceRatio={0.85}86 pagination={87 showPagination88 ? {89 clickable: true,90 }91 : false92 }93 navigation={94 showNavigation95 ? {96 nextEl: ".swiper-button-next",97 prevEl: ".swiper-button-prev",98 }99 : false100 }101 className="card-deck h-[360px] w-[240px] sm:h-[420px] sm:w-[280px]"102// … truncated
What it pulls in
npm packages
Files it writes
More from delta-components
All 93 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| admonitionadmonition | delta-components | Components | Free | 1 dep | |
| cambio-imagecambio-image | delta-components | Components | Free | 2 deps | |
| chatchat | delta-components | Components | Free | 3 deps | |
| code-blockcode-block | delta-components | Components | Free | 3 deps | |
| code-block-iconscode-block-icons | delta-components | Components | Free | no deps | |
| copy-buttoncopy-button | delta-components | Components | Free | 1 dep | |
| input-otpinput-otp | delta-components | Components | Free | 1 dep | |
| mapbox-pointermapbox-pointer | delta-components | Components | Free | no deps |
