Dev Helpers
← Back

Labeled section landmark

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

Open this example in the interactive library

Live preview

Source code

// components/LabeledSectionLandmark.tsx

import { useId } from "react";

import type { ReactNode } from "react";

export default function LabeledSectionLandmark({
  heading = "Workshop",
  children = "Details are available at the front desk.",
}: { heading?: string; children?: ReactNode } = {}) {
  const id = useId();
  return (
    <section aria-labelledby={id}>
      <h2 id={id}>{heading}</h2>
      {children}
    </section>
  );
}