Accordion Retro
pixelflow-ui/accordion-retroFreeComponent
pixelflow-ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by pixelflow-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://pixelflowui.lok1.dev/r/accordion-retro.jsonSource
1"use client";23import * as React from "react";4import * as AccordionPrimitive from "@radix-ui/react-accordion";5import { Plus, Minus } from "lucide-react";6import { motion } from "motion/react";7import { cn } from "@/lib/utils";89const demoOptions = [10 {11 title: "SYSTEM_OVERVIEW",12 description: "Core processing unit initialized.",13 },14 {15 title: "TECHNICAL_SPECS",16 description: "Architecture: 64-bit retro-grid.",17 },18];1920const AccordionRetro = AccordionPrimitive.Root;2122const AccordionItemRetro = React.forwardRef(({ className, ...props }, ref) => (23 <AccordionPrimitive.Item24 ref={ref}25 className={cn(26 "border-b-2 border-black last:border-b-2 first:border-t-2",27 className28 )}29 {...props}30 />31));32AccordionItemRetro.displayName = "AccordionItemRetro";3334const AccordionTriggerRetro = React.forwardRef(35 ({ className, children, ...props }, ref) => (36 <AccordionPrimitive.Header className="flex">37 <AccordionPrimitive.Trigger38 ref={ref}39 className={cn(40 "flex flex-1 items-center justify-between py-4 text-base font-bold font-mono uppercase transition-all hover:bg-black hover:text-white px-4 group data-[state=open]:bg-black data-[state=open]:text-white",41 className42 )}43 {...props}44 >45 {children}46 <div className="relative w-4 h-4 flex items-center justify-center">47 <Plus className="h-4 w-4 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-90 group-data-[state=open]:hidden" />48 <Minus className="h-4 w-4 shrink-0 transition-transform duration-200 hidden group-data-[state=open]:block" />49 </div>50 </AccordionPrimitive.Trigger>51 </AccordionPrimitive.Header>52 )53);54AccordionTriggerRetro.displayName = AccordionPrimitive.Trigger.displayName;5556const AccordionContentRetro = React.forwardRef(57 ({ className, children, ...props }, ref) => {58 const internalRef = React.useRef(null);59 const [isOpen, setIsOpen] = React.useState(false);6061 React.useEffect(() => {62 const element = internalRef.current;63 if (!element) return;6465 const updateState = () => {66 const state = element.getAttribute("data-state");67 setIsOpen(state === "open");68 };6970 updateState();7172 const observer = new MutationObserver((mutations) => {73 mutations.forEach((mutation) => {74// … truncated
What it pulls in
npm packages
Files it writes
More from pixelflow-ui
All 35 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordion Lyraaccordion-lyra | pixelflow-ui | Components | Free | 3 deps | |
| Accordion Novaaccordion-nova | pixelflow-ui | Components | Free | 3 deps | |
| Background 1background-1 | pixelflow-ui | Components | Free | no deps | |
| Background 1Retrobackground-1-retro | pixelflow-ui | Components | Free | no deps | |
| Bouncy Input Lyrabouncy-input-lyra | pixelflow-ui | Components | Free | 1 dep | |
| Bouncy Input Novabouncy-input-nova | pixelflow-ui | Components | Free | 1 dep | |
| Bouncy Input Retrobouncy-input-retro | pixelflow-ui | Components | Free | 1 dep | |
| Button 1button-1 | pixelflow-ui | Components | Free | no deps |
