Accordian

Accordion component with smooth expand/collapse animations

$ npx @hritik-sharmaa/repeat-ui add commons-accordian
Category
Commons
Added
Sep 4, 2025
Version
2.0.0
Packages
motion
Flavors
TS · JS · Tailwind · CSS
Live preview
Customize
16px
import CommonsAccordian from "@/components/repeat-ui/commons-accordian/preview";

<CommonsAccordian items={items} />

Installation

  1. Run the command

    Adds the files and installs any packages they need. Works with npm, pnpm, yarn and bun.

    $ npx @hritik-sharmaa/repeat-ui add commons-accordian --variant ts-tailwind
  2. Use it

    The files are in components/repeat-ui/commons-accordian/.

    import CommonsAccordian from "@/components/repeat-ui/commons-accordian/preview";
    
    export default function Page() {
      return <CommonsAccordian />;
    }

Props

PropTypeDefaultDescriptionOptions
itemsAccordionItem[]-Rows: { id, title, content }.-
allowMultiplebooleanfalseLet several rows stay open at once.-
defaultOpen(string | number)[][]Ids of rows open at first.-
variant"bordered" | "separated""bordered"One bordered box, or a separate card per row.bordered | separated
icon"chevron" | "plus""chevron"A chevron that flips, or a plus that turns into a cross.chevron | plus
accentColorstring"#f97316"Colour of the open row's title and icon.-
radiusnumber16Corner radius in pixels.-
classNamestring""Extra classes for the root element.-

More commons

See all