Accordion Nova
pixelflow-ui/accordion-novaFreeComponent
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-nova.jsonSource
1"use client";23import * as React from "react";4import * as AccordionPrimitive from "@radix-ui/react-accordion";5import { ChevronDown } from "lucide-react";6import { motion} from "framer-motion";7import { cn } from "@/lib/utils";89const demoOptions = [10 {11 title: "Product Information",12 description:13 "Our flagship product combines cutting-edge technology with sleek design. Built with premium materials, it offers unparalleled performance and reliability.",14 },15 {16 title: "Product Information",17 description:18 "Our flagship product combines cutting-edge technology with sleek design. Built with premium materials, it offers unparalleled performance and reliability.",19 },20 {21 title: "Product Information",22 description:23 "Our flagship product combines cutting-edge technology with sleek design. Built with premium materials, it offers unparalleled performance and reliability.",24 },25 {26 title: "Product Information",27 description:28 "Our flagship product combines cutting-edge technology with sleek design. Built with premium materials, it offers unparalleled performance and reliability.",29 },30];3132export default function AccordionDemo({options=demoOptions}) {33 const [openIndex, setOpenIndex] = React.useState(0);3435 return (36 <Accordion37 type="single"38 collapsible39 value={`item-${openIndex}`}40 onValueChange={(val) => {41 setOpenIndex(val ? parseInt(val.split("-")[1]) : null);42 }}43 className="w-full"44 >45 {options.map((item, i) => {46 const isAboveOpen = openIndex === i - 1;47 const isBelowOpen = openIndex === i + 1;4849 return (50 <AccordionItem51 key={i}52 value={`item-${i}`}53 className={cn(54 isAboveOpen && "border-t rounded-t-2xl",55 isBelowOpen && "border-b rounded-b-2xl",56 "border-white/20 hover:bg-zinc-700/20 transition-all duration-300 px-3"57 )}58 >59 <AccordionTrigger className='text-lg font-medium'>{item.title}</AccordionTrigger>60 <AccordionContent className="text-base">{item.description}</AccordionContent>61 </AccordionItem>62 );63 })}64 </Accordion>65 );66}6768const Accordion = AccordionPrimitive.Root;6970const AccordionItem = React.forwardRef(({ className, ...props }, ref) => (71 <AccordionPrimitive.Item72 ref={ref}73 className={cn(74 "hover:cursor-pointer transition-all",75// … 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 Retroaccordion-retro | 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 |
