Dev Helpers
← Back

Native disclosure panel

Import and render <NativeDisclosurePanel /> in a React project.

Open this example in the interactive library

Live preview

Source code

// components/NativeDisclosurePanel.tsx

import type { ReactNode } from "react";

export default function NativeDisclosurePanel({
  title = "Delivery",
  children = "Arrives in two days.",
}: { title?: string; children?: ReactNode } = {}) {
  return (
    <details>
      <summary>{title}</summary>
      {children}
    </details>
  );
}