Open this example in the interactive library
Live preview
Source code
// components/RequiredFieldLegend.tsx
export default function RequiredFieldLegend({
label = "Display name",
hint = "Visible to your team",
}: { label?: string; hint?: string } = {}) {
return (
<fieldset>
<legend>{label}</legend>
<p>{hint}</p>
<label>
Value (required)
<input required />
</label>
</fieldset>
);
}
