Glin UI
Primitive / Molecule

Accordion

Expandable content sections with smooth disclosure behavior.

Edit on GitHub

Billing questions

Yes. Cancel from Billing and your plan stays active until the end of the period.

Installation

Install from
pnpm dlx @glinui/cli@latest add accordion

Prefer the package?

Usage

Variants

glinr, plain (shadcn borders), solid, soft, outline and glass (opt-in).

glinr

Components ship with Tailwind classes. Add the preset once and every component works.

plain

Components ship with Tailwind classes. Add the preset once and every component works.

solid

Components ship with Tailwind classes. Add the preset once and every component works.

soft

Components ship with Tailwind classes. Add the preset once and every component works.

outline

Components ship with Tailwind classes. Add the preset once and every component works.

glass

Components ship with Tailwind classes. Add the preset once and every component works.

import { Accordion } from "@glinui/ui"
<Accordion variant="plain" type="single" collapsible>...</Accordion>

Multiple open

Use type multiple with the separated look when readers compare answers.

Orders ship within 2 business days. Tracking is emailed once the parcel leaves our warehouse.

Return unused items within 30 days for a full refund to your original payment method.

import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@glinui/ui"
export function Demo() {
return (
<Accordion type="multiple" defaultValue={["shipping", "returns"]} variant="separated" className="w-full max-w-xl">
<AccordionItem value="shipping">
<AccordionTrigger>Shipping</AccordionTrigger>
<AccordionContent>Orders ship within 2 business days. Tracking is emailed once the parcel leaves our warehouse.</AccordionContent>
</AccordionItem>
<AccordionItem value="returns">
<AccordionTrigger>Returns</AccordionTrigger>
<AccordionContent>Return unused items within 30 days for a full refund to your original payment method.</AccordionContent>
</AccordionItem>
<AccordionItem value="warranty">
<AccordionTrigger>Warranty</AccordionTrigger>
<AccordionContent>Every product includes a two year warranty against manufacturing defects.</AccordionContent>
</AccordionItem>
</Accordion>
)
}

In a layout

A help-center section with the FAQ beside a heading.

Frequently asked

Quick answers about installing and theming.

Components ship with Tailwind classes. Add the preset once and every component works.

import { Accordion } from "@glinui/ui"
<section className="grid gap-6 md:grid-cols-[1fr_1.4fr]">
<div>...</div>
<Accordion type="single" collapsible>...</Accordion>
</section>

Frosted Variant

Heavier frost with stronger blur and an inner glow. Toggle backgrounds above to compare.

import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "@glinui/ui"

export function AccordionFrostedDemo() {
  return (
    <Accordion type="single" collapsible>
      <AccordionItem value="one" variant="frosted">
        <AccordionTrigger variant="frosted">Installation</AccordionTrigger>
        <AccordionContent variant="frosted">Run pnpm add @glinui/ui @glinui/tokens to get started.</AccordionContent>
      </AccordionItem>
      <AccordionItem value="two" variant="frosted">
        <AccordionTrigger variant="frosted">Configuration</AccordionTrigger>
        <AccordionContent variant="frosted">Import the CSS tokens in your root layout file.</AccordionContent>
      </AccordionItem>
      <AccordionItem value="three" variant="frosted">
        <AccordionTrigger variant="frosted">Usage</AccordionTrigger>
        <AccordionContent variant="frosted">Import components and apply variant props.</AccordionContent>
      </AccordionItem>
    </Accordion>
  )
}

Lift accordion

The list is one lift surface with hairline dividers and a rotating caret. Items inherit the variant from the root.

import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@glinui/ui"

export function Demo() {
  return (
    <Accordion type="single" collapsible variant="lift">
      <AccordionItem value="1">
        <AccordionTrigger>Is it free?</AccordionTrigger>
        <AccordionContent>Yes, up to 10k monthly active users.</AccordionContent>
      </AccordionItem>
      <AccordionItem value="2">
        <AccordionTrigger>Can I self-host?</AccordionTrigger>
        <AccordionContent>Yes.</AccordionContent>
      </AccordionItem>
    </Accordion>
  )
}

Native details fallback (SSR, no JS)

Same geometry with plain details and summary for static pages. Swap to the Radix accordion after hydration without layout shift.

export function Demo() {
  return (
    <div className="overflow-hidden rounded-xl border border-transparent [box-shadow:var(--elev-2)] [background:var(--sheen)_padding-box,linear-gradient(var(--face-0),var(--face-0))_padding-box,var(--ring)_border-box]">
      <details className="group border-b border-[var(--line-soft)] last:border-b-0">
        <summary className="flex cursor-pointer list-none items-center justify-between px-4 py-3.5 text-sm font-medium [&::-webkit-details-marker]:hidden">
          Is it free?
          <span className="transition-transform group-open:rotate-180" aria-hidden="true">v</span>
        </summary>
        <p className="px-4 pb-4 text-sm text-[var(--color-muted)]">Yes.</p>
      </details>
    </div>
  )
}

Accessibility

  • Built on Radix Accordion with full WAI-ARIA.
  • Content regions are associated via `aria-controls`.
  • Use concise trigger labels.

Keyboard Interactions

KeyAction
Enter / SpaceToggle the focused item open/closed.
Arrow UpMove focus to the previous trigger.
Arrow DownMove focus to the next trigger.

ARIA Attributes

  • `role="region"` on content
  • `aria-expanded` on trigger
  • `aria-controls` linking trigger to content

Reduced Motion

Open/close height transitions respect `prefers-reduced-motion`.

Affected properties

height

API Reference

Accordion

PropTypeRequiredDefaultDescription
type"single" | "multiple"-singleAllow one or multiple open items.
collapsibleboolean-falseAllow closing all items when type is single.
defaultValuestring | string[]--Initially open item value(s).
valuestring | string[]--Controlled open item value(s).
onValueChange(value: string | string[]) => void--Open state change handler.
contentSizeSizeNo-Padding size matching the trigger
sizeSize | nullNo-Auto-generated from TypeScript source.
variantAccordionVariant | nullNo-Auto-generated from TypeScript source.

AccordionItem

PropTypeRequiredDefaultDescription
valuestring--Unique identifier for the item.
variantAccordionVariant | nullNodefaultVisual treatment.
sizeSize | nullNomdDensity scale.
disabledboolean-falsePrevents interaction.
contentSizeSizeNo-Padding size matching the trigger

AccordionTrigger

PropTypeRequiredDefaultDescription
variantAccordionVariant | nullNodefaultVisual treatment.
sizeSize | nullNomdDensity scale.
contentSizeSizeNo-Padding size matching the trigger

AccordionContent

PropTypeRequiredDefaultDescription
variantAccordionVariant | nullNodefaultVisual treatment.
contentSizeSizeNomdContent area density scale.
sizeSize | nullNo-Auto-generated from TypeScript source.

Source

Import directly from the package or browse the source on GitHub. Click any file to view it.

Import

import { Accordion } from "@glinui/ui"

Source Files

Dependencies

@glinui/ui

Generated API Snapshot

Beta

Auto-extracted from TypeScript source in packages/ui/src/components/accordion.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.

Generated: 2026-10-08T01:41:21.546Z · Full index: /docs/api-metadata

Primary Props Type

AccordionProps

AccordionContentProps

PropTypeRequiredDefaultDescription
contentSizeSizeNo-Padding size matching the trigger
sizeSize | nullNo--
variantAccordionVariant | nullNo--

AccordionItemProps

PropTypeRequiredDefaultDescription
sizeSize | nullNo--
variantAccordionVariant | nullNo--

AccordionProps

PropTypeRequiredDefaultDescription
variantAccordionVariantNo-Omitted follows the ambient style (glinr by default). `glass` is opt-in and needs a backdrop.

AccordionTriggerProps

PropTypeRequiredDefaultDescription
sizeSize | nullNo--
variantAccordionVariant | nullNo--