family-button
cult-ui/family-buttonUnverifiedComponent
Button component with family-style design and interactive hover effects
Install it
npx shadcn@latest add https://raw.githubusercontent.com/nolly-studio/cult-ui/HEAD/apps/www/family-button.jsonSource
1"use client"23import { FC, ReactNode, useState } from "react"4import { PlusIcon, XIcon } from "lucide-react"5import { motion } from "motion/react"67import { cn } from "@/lib/utils"89const CONTAINER_SIZE = 2001011interface FamilyButtonProps {12 children: React.ReactNode13}1415const FamilyButton: React.FC<FamilyButtonProps> = ({ children }) => {16 const [isExpanded, setIsExpanded] = useState(false)17 const toggleExpand = () => setIsExpanded(!isExpanded)1819 return (20 <div21 className={cn(22 "rounded-[24px] border border-black/10 shadow-sm dark:border-yellow-400/20",23 "bg-gradient-to-b from-neutral-900 to-black",24 isExpanded25 ? "w-[204px] bg-gradient-to-b dark:from-stone-900 dark:to-neutral-900/80"26 : "dark:from-neutral-900 dark:to-stone-950 bg-gradient-to-b"27 )}28 >29 <div className="rounded-[23px] border border-black/10 ">30 <div className="rounded-[22px] border dark:border-stone-800 border-white/50 ">31 <div className="rounded-[21px] border border-neutral-950/20 flex items-center justify-center ">32 <FamilyButtonContainer33 isExpanded={isExpanded}34 toggleExpand={toggleExpand}35 >36 {isExpanded ? (37 <motion.div38 initial={{ opacity: 0 }}39 animate={{40 opacity: 1,41 transition: {42 delay: 0.3,43 duration: 0.4,44 ease: "easeOut",45 },46 }}47 >48 {children}49 </motion.div>50 ) : null}51 </FamilyButtonContainer>52 </div>53 </div>54 </div>55 </div>56 )57}5859// A container that wraps content and handles animations60interface FamilyButtonContainerProps {61 isExpanded: boolean62 toggleExpand: () => void63 children: ReactNode64}6566const FamilyButtonContainer: FC<FamilyButtonContainerProps> = ({67 isExpanded,68 toggleExpand,69 children,70}) => {71 return (72 <motion.div73 className={cn(74 "relative border-white/10 border shadow-lg flex flex-col space-y-1 items-center text-white cursor-pointer z-10",75 !isExpanded76 ? "bg-gradient-to-b from-neutral-900 to-stone-900 dark:from-stone-700 dark:to-neutral-800/80"77 : ""78 )}79 layoutRoot80 layout81 initial={{ borderRadius: 21, width: "4rem", height: "4rem" }}82 animate={83// … truncated
Files it writes
More from cult/ui
All 157 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| ai-instructionsai-instructions | cult/ui | Components | Unverified | 2 deps | |
| ai-instructions-demoai-instructions-demo | cult/ui | Components | Unverified | no deps | |
| animated-numberanimated-number | cult/ui | Components | Unverified | 1 dep | |
| animated-number-demoanimated-number-demo | cult/ui | Components | Unverified | no deps | |
| bg-animate-buttonbg-animate-button | cult/ui | Components | Unverified | no deps | |
| bg-animate-button-demobg-animate-button-demo | cult/ui | Components | Unverified | no deps | |
| bg-animated-fractal-dot-gridbg-animated-fractal-dot-grid | cult/ui | Components | Unverified | 1 dep | |
| bg-animated-fractal-dot-grid-demobg-animated-fractal-dot-grid-demo | cult/ui | Components | Unverified | no deps |
