Dev Helpers
← Back

Figure with custom content

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

Open this example in the interactive library

Live preview

Source code

// components/FigureWithCustomContent.tsx

import type { ReactNode } from "react";

export default function FigureWithCustomContent({
  heading = "Workshop",
  children = "Details are available at the front desk.",
}: { heading?: string; children?: ReactNode } = {}) {
  return (
    <figure>
      {children}
      <figcaption>{heading}</figcaption>
    </figure>
  );
}