shadcn-remix
GitHub

Accordion

A vertically stacked set of interactive headings that each reveal a section of content.

Our flagship product combines cutting-edge technology with sleek design. Built with premium materials, it offers unparalleled performance and reliability.

Key features include advanced processing capabilities, and an intuitive user interface designed for both beginners and experts.

We offer worldwide shipping through trusted courier partners. Standard delivery takes 3-5 business days, while express shipping ensures delivery within 1-2 business days.

All orders are carefully packaged and fully insured. Track your shipment in real-time through our dedicated tracking portal.

We stand behind our products with a comprehensive 30-day return policy. If you're not completely satisfied, simply return the item in its original condition.

Our hassle-free return process includes free return shipping and full refunds processed within 48 hours of receiving the returned item.

import { css } from 'remix/component'

import {
  Accordion,
  AccordionContent,
  AccordionItem,
import { css } from 'remix/component'

import {
  Accordion,
  AccordionContent,
  AccordionItem,
  AccordionTrigger,
} from '#app/ui/accordion.tsx'

const contentStyles = css({
  display: 'flex',
  flexDirection: 'column',
  gap: '1rem',
  textWrap: 'balance',
})

export function AccordionDemo() {
  return () => (
    <Accordion type="single" collapsible mix={css({ width: '100%' })} defaultValue="item-1">
      <AccordionItem value="item-1">
        <AccordionTrigger>Product Information</AccordionTrigger>
        <AccordionContent mix={contentStyles}>
          <p>
            Our flagship product combines cutting-edge technology with sleek design. Built with
            premium materials, it offers unparalleled performance and reliability.
          </p>
          <p>
            Key features include advanced processing capabilities, and an intuitive user interface
            designed for both beginners and experts.
          </p>
        </AccordionContent>
      </AccordionItem>
      <AccordionItem value="item-2">
        <AccordionTrigger>Shipping Details</AccordionTrigger>
        <AccordionContent mix={contentStyles}>
          <p>
            We offer worldwide shipping through trusted courier partners. Standard delivery takes
            3-5 business days, while express shipping ensures delivery within 1-2 business days.
          </p>
          <p>
            All orders are carefully packaged and fully insured. Track your shipment in real-time
            through our dedicated tracking portal.
          </p>
        </AccordionContent>
      </AccordionItem>
      <AccordionItem value="item-3">
        <AccordionTrigger>Return Policy</AccordionTrigger>
        <AccordionContent mix={contentStyles}>
          <p>
            We stand behind our products with a comprehensive 30-day return policy. If you&apos;re
            not completely satisfied, simply return the item in its original condition.
          </p>
          <p>
            Our hassle-free return process includes free return shipping and full refunds processed
            within 48 hours of receiving the returned item.
          </p>
        </AccordionContent>
      </AccordionItem>
    </Accordion>
  )
}

Installation

$ pnpm dlx shadcn@latest add https://www.shadcn-remix.com/r/accordion.json

Usage

import {
  Accordion,
  AccordionContent,
  AccordionItem,
  AccordionTrigger,
} from '#app/ui/accordion.tsx'
<Accordion type="single" collapsible defaultValue="item-1">
  <AccordionItem value="item-1">
    <AccordionTrigger>Is it accessible?</AccordionTrigger>
    <AccordionContent>
      Yes. It adheres to the WAI-ARIA design pattern.
    </AccordionContent>
  </AccordionItem>
</Accordion>

Composition

Use the following composition to build an Accordion:

Accordion
└── AccordionItem
    ├── AccordionTrigger
    └── AccordionContent

API Reference

Accordion

Root <div>. Arrow Up/Down, Home and End move focus between triggers.

PropTypeDefault
type"single" | "multiple"-
valuestring | string[]-
defaultValuestring | string[]-
onValueChange(value: string | string[]) => void-
collapsiblebooleanfalse
disabledbooleanfalse
mixMixValue-

AccordionItem

Item wrapper <div> with data-state="open" | "closed".

PropTypeDefault
valuestring-
disabledbooleanfalse
mixMixValue-

AccordionTrigger

A <button> inside an <h3>, with a chevron that rotates when open.

PropTypeDefault
mixMixValue-

AccordionContent

The collapsible region. Animates its height when toggled. mix styles the inner wrapper.

PropTypeDefault
mixMixValue-