MeDo

KI-Accordion-Generator.

Beschreiben Sie Ihre Abschnitte und MeDo generiert ein ausklappbares Accordion — einzeln oder mehrfach geöffnet, eine Höhenanimation, die mit jeder Inhaltslänge funktioniert, Deep Links, die ein Panel automatisch öffnen, und passendes FAQPage-JSON-LD für Rich Results.

Accordion
Accordion

Ein eingeklapptes Panel ist eine Wette darauf, dass der Inhalt optional ist

Accordions werden meist eingebaut, damit eine Seite kürzer wirkt, aber diese Kürzung ist nicht kostenlos. Jeder eingeklappte Abschnitt tauscht Überfliegbarkeit gegen Dichte: Wer sonst sechs Antworten überflogen hätte, muss sich jetzt für einen Klick entscheiden — und die meisten klicken gar nichts. Bei wirklich sekundärem Material wie Versandbedingungen, Randfällen oder langen Spezifikationstabellen lohnt sich dieser Tausch; bei den zwei oder drei Antworten, die tatsächlich einen Kaufeinwand auflösen, ist er schlecht. Die nützliche Disziplin lautet: Holen Sie Ihre Inhalte mit der höchsten Kaufabsicht aus dem Accordion heraus in den normalen Seitentext und lassen Sie das Accordion den Long Tail aufnehmen. Das löst auch die SEO-Seite desselben Problems, denn Text in einem geschlossenen Panel, der im HTML vorhanden ist, wird indexiert, während Text, der erst nach einem Klick eingefügt wird, möglicherweise nicht.

6 Vorlagen

Accordion-Vorlagen, die Sie generieren können

Jede Vorlage ist ein echter Prompt, kein Screenshot. Kopieren Sie ihn in einen KI-Editor oder führen Sie ihn in MeDo aus und erhalten Sie React- und Tailwind-Code zurück.

BasicFAQ Single-Open

Exclusive-Open FAQ List

One answer visible at a time, which keeps a long FAQ from turning into a wall once someone starts clicking. The default for landing-page questions.

Create an FAQ accordion with six items in single-open mode, where opening one item closes the currently open one. Each header is a full-width button carrying the question in 16px semibold text with a chevron on the right that rotates 180 degrees over 200ms; set aria-expanded on the button and aria-controls pointing at the panel, and give the panel role="region" with aria-labelledby back to the header id. Animate the panel with grid-template-rows from 0fr to 1fr so long answers never clip and short ones do not ease for the same duration. Enter and Space toggle, Tab moves between headers normally since each is its own tab stop, and a visible focus-visible ring is required. Allow the open item to be collapsed so no panel is forced open.

In MeDo testen
ComparisonMulti-Open

Several Panels Open at Once

For troubleshooting steps and spec tables, where someone genuinely needs two sections side by side. Add Expand all only here — it is meaningless in exclusive mode.

Create a multi-open accordion where any number of panels may be expanded at once, holding open ids in a set rather than a single value. Add an Expand all and Collapse all control above the stack whose label reflects the current state, and make it a real button with aria-expanded describing the group. Each header is a button with aria-expanded and aria-controls; each panel is role="region" with aria-labelledby. Animate with grid-template-rows 0fr to 1fr so several simultaneous transitions do not fight a shared max-height. Preserve panel scroll position and any half-filled form fields by keeping panels in the DOM and toggling the hidden attribute rather than unmounting them. Enter and Space toggle the focused header.

In MeDo testen
No JavaScriptNative Details

Details and Summary Accordion

Works before your bundle loads, is keyboard accessible with zero attributes, and joins find-in-page so a browser search opens the matching panel. The baseline to beat.

Create an accordion using native details and summary elements with no JavaScript at all. Give each details the same name attribute so the browser enforces exclusive-open behavior natively. Style the summary as a full-width row with 20px vertical padding, remove the default marker with list-style: none and ::-webkit-details-marker, and add a custom chevron that rotates using the details[open] selector. Animate the panel with interpolate-size: allow-keywords plus a height transition from 0 to auto, and add ::details-content to the transition so the reveal is smooth where supported and an instant open elsewhere. Keep a visible focus ring on the summary and ensure find-in-page still expands a closed panel.

In MeDo testen
ShareableDeep Linked

Hash-Opened Panels With Copy Link

Every panel gets its own URL, so a support reply can point at one answer rather than "scroll down to the FAQ". The offset for the sticky header is the part that gets skipped.

Create an accordion where each item is addressable by URL hash. Give every header a stable slug id derived from its question, and on mount read location.hash, open the matching panel, and scroll it into view with scroll-margin-top of 96px so it does not land underneath a sticky header. Update the hash on open using history.replaceState so the back button is not filled with toggles, and listen for hashchange so in-page links work after the first render. Add a small copy-link button inside each header row that writes the absolute URL to the clipboard and swaps its label to Copied for two seconds; stop its click from bubbling to the header button so copying does not also collapse the panel.

In MeDo testen
SEOFAQ Schema

Accordion With FAQPage JSON-LD

Panels and structured data generated from one array, which is the only way they stay in sync six months later. Treat the markup as a clarity signal, not a guaranteed rich result.

Create an FAQ accordion that renders both the interactive panels and a matching FAQPage JSON-LD script from the same array of question and answer objects, so the two cannot drift apart when someone edits a question. Emit the JSON-LD server-side in a script tag with type="application/ld+json", using Question and Answer entities with acceptedAnswer text. Render every answer into the HTML even while collapsed, hiding it with CSS rather than fetching it on click, since content injected after a click may never be crawled. Keep the accessible pattern intact: header buttons with aria-expanded and aria-controls, panels as role="region" with aria-labelledby, and a grid-template-rows height animation.

In MeDo testen
NestedNested Groups

Grouped Accordion With Sub-Sections

Two levels for a long feature matrix or a knowledge base. Depth past two is where people lose the thread — if you need a third, the content wants its own page.

Create a nested accordion two levels deep: outer groups such as Security, Integrations and Support, each containing three to five child items. Indent child headers by 20px, drop their type size by one step, and keep every level as its own button with aria-expanded and aria-controls, panels as role="region" with aria-labelledby — do not use a treeview role, since these are disclosures, not a tree. Outer groups are multi-open and children are single-open within their parent. When a parent collapses, remember which children were open so reopening the parent restores that state rather than resetting it, and make sure the parent panel height animation accounts for children expanding after the parent has settled.

In MeDo testen

So passen Sie Ihre Accordion an

Entscheiden Sie vorab zwischen <details> und einem Button

Ein natives Paar aus <details> und <summary> funktioniert ohne jedes JavaScript, ist von Haus aus tastaturzugänglich und bleibt geöffnet, wenn der Browser die Seite durchsucht. Ein Button mit aria-expanded gibt Ihnen die volle Kontrolle über Animation und exklusive Öffnen-Logik. Nennen Sie die gewünschte Variante, denn beide erzeugen völlig unterschiedliches Markup.

Animieren Sie nie auf ein fest codiertes max-height

Ein festes max-height schneidet lange Antworten ab und lässt kurze über dieselbe Dauer ausklingen. Bitten Sie um grid-template-rows von 0fr auf 1fr oder um interpolate-size mit calc-size für height auto, damit der Übergang der echten Inhaltshöhe folgt.

Seien Sie klar bei einzeln geöffnet versus mehrfach geöffnet

Exklusives Öffnen hält die Seite kurz und den Leser auf eine Antwort fokussiert. Mehrere gleichzeitig geöffnete Panels sind besser, wenn Menschen Abschnitte vergleichen oder Details aus zwei davon herauskopieren. Legen Sie den Standard fest und ob alle Elemente geschlossen werden dürfen, denn manche Accordions halten immer ein Panel offen.

Fordern Sie Deep Links und Scroll-Offset gemeinsam an

Ein Panel über einen URL-Hash zu öffnen ist nur die Hälfte der Funktion. Ohne expliziten Scroll-Offset landet das Ziel unter einem Sticky-Header — nennen Sie daher die Header-Höhe und fordern Sie scroll-margin-top oder einen skriptgesteuerten Offset im selben Prompt an.

Wer die Accordion-Komponente nutzt

FAQ-Bereich einer Marketing-Seite

Acht Fragen in einem Accordion mit exklusivem Öffnen am Ende einer Landingpage, jedes Element per Deep Link ansprechbar, damit Support-Antworten auf eine einzelne Antwort verweisen können, mit FAQPage-JSON-LD aus demselben Daten-Array.

E-Commerce-Produktseite

Versand, Rückgabe und Pflegehinweise unter dem In-den-Warenkorb-Button eingeklappt — die Kaufbox bleibt im sichtbaren Bereich, während der Richtlinientext für Suchmaschinen im HTML verbleibt.

Dokumentation oder Wissensdatenbank

Schritte zur Fehlerbehebung in einem Accordion mit Mehrfachöffnung, damit Leser zwei verwandte Abschnitte gleichzeitig ausgeklappt lassen können, während sie eine Lösung durcharbeiten.

Vergleich auf der Preisseite

Eine lange Feature-Matrix in ausklappbare Gruppen wie Sicherheit, Integrationen und Support aufgeteilt, damit die Tarifspalten sichtbar bleiben, anstatt hinter drei Bildschirmen voller Zeilen zu verschwinden.

Accordion-Muster für verschiedene Websites

Dieselbe accordion-Komponente, abgestimmt auf die Art der Website, auf der sie läuft.

01 / 06

Marketing Site FAQ

Exclusive-open questions at the bottom of a landing page, with the two or three answers that actually resolve a purchase objection promoted out into plain page copy above. An accordion holding your strongest answer is an accordion hiding it.

Accordion-Stile und -Varianten

Wählen Sie die Variante, die zum Rest der Seite passt, und generieren Sie sie.

01 / 06

Divider List Accordion

Flush rows separated by 1px light-grey lines, with no outer border at all. The quietest option and the right one for an FAQ of ten or more items, where card borders and gaps would add more visual noise than structure.

Accordion in React, Next.js, Vue und Svelte

React, Next.js, Vue 3, SvelteKit, Astro oder reines HTML — dieselbe accordion, sechs Wege zur Einbindung.

01 / 06

React Accordion

Hold open ids in a Set so the same component covers single and multi-open — swap the set for one id and you have exclusive mode. No height measurement is needed if the panel animates with grid rows.

src/components/Accordion.tsx

const [open, setOpen] = useState(new Set())

<button
  aria-expanded={open.has(item.id)}
  aria-controls={`panel-${item.id}`}
  onClick={() => toggle(item.id)}
>
  {item.question}
</button>
<div id={`panel-${item.id}`} role="region" className="grid"
     style={{ gridTemplateRows: open.has(item.id) ? '1fr' : '0fr' }}>
  <div className="overflow-hidden">{item.answer}</div>
</div>

So fügen Sie Ihre Accordion einem Projekt hinzu

Vier Schritte, von der Auswahl einer accordion-Vorlage bis zum Einsatz in der Produktion.

01~30s

Pick an Accordion Template

Decide two things first: single or multi-open, and native details versus a button with aria-expanded. Those choices produce different markup, so picking after generation means regenerating.

02~10s

Copy the Prompt

Take the prompt into MeDo, Lovable, Bolt, v0 or Cursor and paste your real questions and answers in place of the placeholders. If you want FAQPage JSON-LD, say so now so it is generated from the same array rather than hand-written later.

03~1min

Generate and Refine

You get React + Tailwind back with a live preview. Follow up in plain English — "allow several open at once", "open the panel matching the URL hash", "swap the chevron for a plus" — instead of editing the transition by hand.

04~2min

Check the Content and Ship

Before shipping, confirm the longest answer does not clip mid-animation, every answer is present in the HTML while collapsed, and your highest-intent copy is in open page text rather than behind a click.

Häufige Fragen zu Accordion

Wie generiere ich ein FAQ-Accordion mit KI?

Listen Sie Ihre Fragen und Antworten im Prompt auf und geben Sie an, ob ein oder mehrere Panels gleichzeitig geöffnet sein dürfen. MeDo generiert die barrierefreien Kopfzeilen-Buttons mit aria-expanded und aria-controls, die animierten Panels und optional das passende FAQPage-JSON-LD aus demselben Inhalt, sodass Markup und strukturierte Daten nicht auseinanderdriften können.

Sollte ich <details> und <summary> oder ein eigenes Accordion verwenden?

Verwenden Sie <details> und <summary>, wenn Sie eine verlässliche Basis wollen: Es funktioniert, bevor JavaScript geladen ist, ist ohne jedes Attribut tastatur- und screenreadertauglich und nimmt an der Seitensuche des Browsers teil. Greifen Sie zu einem Button mit aria-expanded, wenn Sie exklusives Öffnen, eine kontrollierte Animationskurve oder Zustand in der URL brauchen. Das native Element lässt sich inzwischen ebenfalls animieren, da Browser Übergänge von content-visibility und height mit interpolate-size unterstützen.

Wie animiere ich ein Accordion auf height auto?

Packen Sie das Panel in ein CSS-Grid und lassen Sie grid-template-rows von 0fr auf 1fr übergehen, mit overflow hidden auf dem inneren Element. Das folgt der echten Inhaltshöhe ohne Messung in JavaScript. In Browsern, die interpolate-size: allow-keywords unterstützen, können Sie height direkt von 0 auf auto überblenden — einfacher und als Progressive Enhancement lohnend.

Kann ein Accordion-FAQ Rich Results bei Google erhalten?

Möglich ist es, wenn die Seite valide FAQPage-strukturierte Daten enthält und die Fragen und Antworten auch im gerenderten HTML erscheinen. Google hat die Berechtigung für FAQ-Rich-Results weitgehend auf autoritative Regierungs- und Gesundheitsseiten eingeschränkt — behandeln Sie das Markup daher als Klarheitssignal für Suche und KI-Antwortmaschinen und nicht als garantiertes SERP-Feature. Bitten Sie MeDo, das JSON-LD aus demselben Array zu erzeugen, das die Panels rendert, damit beide synchron bleiben.

Beeinträchtigt das Verstecken von Inhalten in einem Accordion das SEO?

Inhalte, die im HTML vorhanden, aber visuell eingeklappt sind, werden normal indexiert, und Google hat erklärt, dass Accordions auf Mobilgeräten ein erwartetes responsives Muster sind. Die echten Risiken sind Antworten, die erst beim Klick geladen werden und dadurch möglicherweise ungecrawlt bleiben, sowie das Vergraben Ihrer wichtigsten Texte an einer Stelle, die niemand ausklappt. Halten Sie die Kernbotschaft im offenen Seitentext und nutzen Sie eingeklappte Panels für unterstützende Details.

Sollte ich ein Accordion oder Tabs verwenden?

Wählen Sie ein Accordion, wenn die Abschnitte unabhängig voneinander sind, die Beschriftungen lang genug sind, um sich wie Sätze zu lesen, oder der Leser mehr als einen Abschnitt gleichzeitig offen haben möchte — deshalb sind FAQ-Listen fast immer Accordions. Wählen Sie Tabs, wenn die Panels sich gegenseitig ausschließende Alternativen im Vergleich sind, etwa monatliche gegen jährliche Preise, und die Beschriftungen kurz genug für eine horizontale Reihe sind. Lange, als Frage formulierte Beschriftungen sind das deutlichste Signal, dass Tabs das falsche Muster sind.