Label, control and supporting information grouped together.
This is shown on your public profile.
<div class="fg">
<label class="fg__label" for="fg-1">Username <span class="fg__req">*</span></label>
<input class="fg__input" id="fg-1" type="text" placeholder="jane_doe" style="--accent:#A8E6C1;" aria-describedby="fg-help-1" required>
<p class="fg__helper" id="fg-help-1">This is shown on your public profile.</p>
</div>
<style>
.fg { font: 14px system-ui, sans-serif; color: #241430; max-width: 280px; }
.fg__label { display: block; margin-bottom: 6px; font-weight: 500; }
.fg__req { color: #241430; }
.fg__input { width: 100%; box-sizing: border-box; padding: 10px 12px; font: inherit; color: #241430; background: #FAF7F2; border: 1.5px solid #24143040; border-radius: 8px; }
.fg__input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.fg__helper { margin: 6px 0 0; font-size: 12px; color: #24143099; }
</style><div class="font-sans text-sm text-[#241430] max-w-[280px]">
<label class="block mb-1.5 font-medium" for="fg-tw-1">Username <span>*</span></label>
<input id="fg-tw-1" type="text" placeholder="jane_doe" aria-describedby="fg-tw-help-1" required
class="w-full box-border px-3 py-2.5 bg-[#FAF7F2] border-[1.5px] border-[#24143040] rounded-lg focus-visible:outline-none" style="border-color:#A8E6C1;">
<p id="fg-tw-help-1" class="mt-1.5 text-xs text-[#24143099]">This is shown on your public profile.</p>
</div>export function FormGroup({
label = "Username",
helper = "This is shown on your public profile.",
placeholder = "jane_doe",
accent = "#A8E6C1",
required = true,
}) {
return (
<div style={{ fontFamily: "system-ui, sans-serif", fontSize: 14, color: "#241430", maxWidth: 280 }}>
<label htmlFor="fg-react-1" style={{ display: "block", marginBottom: 6, fontWeight: 500 }}>{label}{required && " *"}</label>
<input id="fg-react-1" type="text" placeholder={placeholder} required={required} aria-describedby="fg-react-help-1" style={{
width: "100%", boxSizing: "border-box", padding: "10px 12px", font: "inherit", color: "#241430",
background: "#FAF7F2", border: `1.5px solid ${accent}`, borderRadius: 8,
}} />
<p id="fg-react-help-1" style={{ margin: "6px 0 0", fontSize: 12, color: "#24143099" }}>{helper}</p>
</div>
);
}