Skip to content
العربية
Data display

Accordion

Sections that open and close, one at a time or several. The arrow keys move between headers. Closed panels stay in the page, hidden: search engines see them, find-in-page opens them, and their content mounts at page load (load heavy media on open).

import { Accordion } from "@percentsa/ui";

Examples

Most websites take four to eight weeks.

Code
export function AccordionExample() {
  const t = useT();
  return (
    <Accordion
      className="w-full max-w-xl"
      defaultValue="time"
      items={[
        {
          value: "time",
          title: t("How long does a project take?", "كم يستغرق المشروع؟"),
          content: t("Most websites take four to eight weeks.", "تستغرق معظم المواقع من أربعة إلى ثمانية أسابيع."),
        },
        {
          value: "price",
          title: t("How do you price work?", "كيف تحددون السعر؟"),
          content: t("A fixed price per project, agreed before we start.", "سعر ثابت لكل مشروع نتفق عليه قبل البدء."),
        },
        {
          value: "support",
          title: t("Do you support the site after launch?", "هل تدعمون الموقع بعد الإطلاق؟"),
          content: t("Yes, with a monthly plan.", "نعم، عبر خطة شهرية."),
        },
      ]}
    />
  );
}