Css Box Demo
fancy/css-box-demoFreeBlock
A block component.
Install it
npx shadcn@latest add https://www.fancycomponents.dev/r/css-box-demo.jsonSource
1import { useRef } from "react"23import CSSBox, { CSSBoxRef } from "@/components/fancy/blocks/css-box"45export default function CSSBoxDemo() {6 const boxRef = useRef<CSSBoxRef>(null)78 // Example text face component9 const TextFace = ({10 texts,11 className,12 }: {13 texts: string[]14 className?: string15 }) => (16 <div className={`flex flex-col ${className || ""}`}>17 {texts.map((text, i) => (18 <div key={i} className="text-[#0015ff] font-bold tracking-wider">19 {text}20 </div>21 ))}22 </div>23 )2425 return (26 <CSSBox27 ref={boxRef}28 width={200}29 height={200}30 depth={200}31 perspective={600}32 stiffness={100}33 damping={30}34 faces={{35 front: (36 <TextFace37 texts={["YOU CAN", "JUST", "DO THINGS"]}38 className="text-right justify-end items-end h-full w-full p-2 select-none"39 />40 ),41 back: (42 <TextFace43 texts={["MAKE THINGS", "YOU WISH", "EXISTED"]}44 className="text-left justify-end h-full w-full p-2 select-none"45 />46 ),47 right: (48 <TextFace49 texts={["MAKE THINGS", "YOU WISH", "EXISTED"]}50 className="text-left justify-end h-full w-full p-2 select-none"51 />52 ),53 left: (54 <TextFace55 texts={["BREAK", "THINGS", "MOVE", "FAST"]}56 className="items-end w-full h-full p-2 select-none"57 />58 ),59 top: (60 <TextFace61 texts={["YOU CAN", "JUST", "DO THINGS"]}62 className="text-right justify-end items-end h-full w-full p-2 select-none"63 />64 ),65 bottom: (66 <TextFace67 texts={["BREAK", "THINGS", "MOVE", "FAST"]}68 className="items-end w-full h-full p-2 select-none"69 />70 ),71 }}72 className="text-3xl"73 />74 )75}
What it pulls in
Other registry items
Files it writes
More from fancy
All 158 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Gradient Demoanimated-gradient-demo | fancy | Blocks | Free | no deps | |
| Basic Number Ticker Demobasic-number-ticker-demo | fancy | Blocks | Free | no deps | |
| Box Carousel Autoplay Demobox-carousel-autoplay-demo | fancy | Blocks | Free | 1 dep | |
| Box Carousel Demobox-carousel-demo | fancy | Blocks | Free | 1 dep | |
| Box Carousel Video Demobox-carousel-video-demo | fancy | Blocks | Free | 1 dep | |
| Breathing Text Demobreathing-text-demo | fancy | Blocks | Free | no deps | |
| Circling Elements Democircling-elements-demo | fancy | Blocks | Free | no deps | |
| Circling Elements Easing Democircling-elements-easing-demo | fancy | Blocks | Free | no deps |
