Skip to content

Accordion Component

Die Accordion-Komponente erstellt zusammenklappbare Inhaltsabschnitte, die dabei helfen, Informationen platzsparend zu organisieren. Benutzer können auf die Kopfzeile klicken, um den Inhalt zu erweitern oder zu reduzieren.

Prop Type Required Description
type Zeichenfolge Nein Datenattribut für Styling oder JavaScript-Targeting
question Zeichenfolge Ja Der im Akkordeon
answer string/HTML Ja Der Inhalt, der angezeigt wird, wenn Akkordeon erweitert wird
  • Interactive Toggle - Click to expand/collapse content
  • Symbolanimation – Das Plussymbol dreht sich, wenn es umgeschaltet wird
  • Responsive Design - Works on all screen sizes
  • Custom Styling - Supports theme customization
  • Accessible - Keyboard navigation support
import Accordion from "../../../../components/user-components/Accordion.astro";
<Accordion
question="What is Dockit?"
answer="Dockit is a modern documentation theme built with Astro and Starlight."
/>
import Accordion from "../../../../components/user-components/Accordion.astro";
<Accordion
type="faq"
question="How do I customize the theme?"
answer="You can customize colors, fonts, and layout through the configuration files."
/>
import Accordion from "../../../../components/user-components/Accordion.astro";
<Accordion
question="Installation"
answer="Führen Sie npm install aus, um mit Dockit zu beginnen."
/>
<Accordion
question="Configuration"
answer="Edit the astro.config.mjs file to customize your site."
/>
<Accordion
question="Deployment"
answer="Deploy to Netlify, Vercel, or any static hosting provider."
/>

Die Komponente enthält integrierte Stile mit Unterstützung für:

  • Helle und dunkle Themenvarianten
  • Schwebe- und Fokuszustände
  • Smooth animations
  • Benutzerdefinierte Abstände und Typografie
  • Use clear, concise questions as headers
  • Sorgen Sie dafür, dass der Inhalt der Antworten fokussiert und lesbar ist
  • Group related accordions together
  • Verwenden Sie die type-Requisite für ein einheitliches Styling bei ähnlichen Akkordeons
Dieses Design anfragen