Animated Accordion
motiq/animated-accordionFreeComponent
Radix Accordion with Motion height/opacity reveal and a rotating chevron. Single/multiple modes, keyboard, and disabled state preserved. Reduced-motion safe.
Live preview
live · rendered by the registry
Rendered by motiq on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.motiq.dev/r/animated-accordion.jsonSource
1"use client";23import * as React from "react";4import { motion, useReducedMotion, type Transition } from "motion/react";5import * as AccordionPrimitive from "@radix-ui/react-accordion";67import { cn } from "@/lib/utils";89const EASE: Transition["ease"] = [0.2, 0, 0, 1];1011/**12 * AnimatedAccordion — Radix Accordion with Motion height/opacity reveal and a13 * rotating chevron.14 *15 * Accessibility: Radix owns the trigger button semantics, `aria-expanded`,16 * keyboard interaction, single/multiple modes, and disabled state — untouched.17 * The chevron is decorative (`aria-hidden`). Content animates on the18 * `data-state` attribute so it stays in the a11y tree throughout. Under19 * `prefers-reduced-motion` open/close is instant with no height animation.20 * Clean-room original.21 */22export const AnimatedAccordion = AccordionPrimitive.Root;2324export const AnimatedAccordionItem = React.forwardRef<25 React.ElementRef<typeof AccordionPrimitive.Item>,26 React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>27>(({ className, ...props }, ref) => (28 <AccordionPrimitive.Item29 ref={ref}30 className={cn(31 "border-b border-[var(--color-border,#e4e7ec)] last:border-b-0",32 className,33 )}34 {...props}35 />36));37AnimatedAccordionItem.displayName = "AnimatedAccordionItem";3839export interface AnimatedAccordionTriggerProps40 extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger> {}4142export const AnimatedAccordionTrigger = React.forwardRef<43 React.ElementRef<typeof AccordionPrimitive.Trigger>,44 AnimatedAccordionTriggerProps45>(({ className, children, ...props }, ref) => (46 <AccordionPrimitive.Header className="flex">47 <AccordionPrimitive.Trigger48 ref={ref}49 className={cn(50 "group flex flex-1 items-center justify-between gap-4 py-4 text-left text-sm font-medium",51 "text-[var(--color-fg,#111318)] transition-colors",52 "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent,#695cff)]",53 "disabled:pointer-events-none disabled:opacity-50",54 className,55 )}56 {...props}57 >58 {children}59 {/* Decorative chevron; rotates via data-state, no motion component needed60 so it respects reduced-motion through CSS transitions we scope off. */}61 <svg62 aria-hidden="true"63 focusable="false"64 viewBox="0 0 24 24"65 width={18}66 height={18}67 fill="none"68 stroke="currentColor"69 strokeWidth={2}70// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from motiq
All 100 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Activity Streamactivity-stream | motiq | Components | Free | 1 dep | |
| Adaptive Safe-Zone Gridadaptive-safe-zone-grid | motiq | Components | Free | no deps | |
| Agent Run Timelineagent-run-timeline | motiq | Components | Free | 1 dep | |
| AI Response Streamai-response-stream | motiq | Components | Free | 1 dep | |
| Animated Buttonanimated-button | motiq | Components | Free | 1 dep | |
| Animated Dialoganimated-dialog | motiq | Components | Free | 2 deps | |
| Animated Gridanimated-grid | motiq | Components | Free | 2 deps | |
| Animated Iconsanimated-icons | motiq | Components | Free | 1 dep |
