Dev Helpers

React / Disclosure

Native disclosure panel

Dev Helpers · February 11, 2026

A native disclosure carries keyboard behaviour and expanded state without React state. A custom summary still needs a useful label.

Worked example

// 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>
  );
}

Implementation notes

Native details state belongs to the browser unless you deliberately control it. Recreating the element under a changing key can close it unexpectedly.

Try it yourself

Toggle it with the keyboard, then navigate through its revealed contents.

Open the React example →

Editorial date February 11, 2026 · Published December 6, 2026

Related articles

Percentage meter

A percentage meter needs both a bounded visual fill and a meaningful textual value. Handle a zero denominator before dividing.

Vertical typesetting sample

Vertical typesetting changes the reading direction and available inline space. Treat the sample text as content so it remains selectable and accessible.

Square cover crop

A square image crop gives a card grid consistent geometry. The crop anchor determines whether the most important part of a photo survives.