Accordion

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

Preview

Installation

Run the following command

bash
npx sigma-ui@latest add accordion

Update tailwind.config.js

Add the following animations to your tailwind.config.js file:

js
/** @type {import('tailwindcss').Config} */
module.exports = {
  theme: {
    extend: {
      keyframes: {
        'accordion-down': {
          from: { height: 0 },
          to: { height: 'var(--radix-accordion-content-height)' },
        },
        'accordion-up': {
          from: { height: 'var(--radix-accordion-content-height)' },
          to: { height: 0 },
        },
      },
      animation: {
        'accordion-down': 'accordion-down 0.2s ease-out',
        'accordion-up': 'accordion-up 0.2s ease-out',
      },
    },
  },
}

Examples

Basic

Multiple

Edit this page on GitHub