Skip to content
← Form Group
Edit Form Group
Name
Also known as (comma separated)
Brief definition
Label, control and supporting information grouped together.
Notes
Tier
Core
Useful
Reference
Deleted
Controls schema (JSON array)
[ { "id": "label", "type": "text", "label": "Label", "default": "Username" }, { "id": "helper", "type": "text", "label": "Helper text", "default": "This is shown on your public profile." }, { "id": "placeholder", "type": "text", "label": "Placeholder", "default": "jane_doe" }, { "id": "accent", "type": "color", "label": "Focus colour", "default": "#A8E6C1", "presets": [ "#A8E6C1", "#F5C2E0", "#BFD9F2", "#D9C8F0", "#E8A020", "#241430" ] }, { "id": "required", "type": "toggle", "label": "Required", "default": true } ]
Templates (JSON object keyed by format)
{ "html": "<div class=\"fg\">\n <label class=\"fg__label\" for=\"fg-1\">{{label}}{{#if required}} <span class=\"fg__req\">*</span>{{/if}}</label>\n <input class=\"fg__input\" id=\"fg-1\" type=\"text\" placeholder=\"{{placeholder}}\" style=\"--accent:{{accent}};\" aria-describedby=\"fg-help-1\"{{#if required}} required{{/if}}>\n <p class=\"fg__helper\" id=\"fg-help-1\">{{helper}}</p>\n</div>\n<style>\n.fg { font: 14px system-ui, sans-serif; color: #241430; max-width: 280px; }\n.fg__label { display: block; margin-bottom: 6px; font-weight: 500; }\n.fg__req { color: #241430; }\n.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; }\n.fg__input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }\n.fg__helper { margin: 6px 0 0; font-size: 12px; color: #24143099; }\n</style>", "tailwind": "<div class=\"font-sans text-sm text-[#241430] max-w-[280px]\">\n <label class=\"block mb-1.5 font-medium\" for=\"fg-tw-1\">{{label}}{{#if required}} <span>*</span>{{/if}}</label>\n <input id=\"fg-tw-1\" type=\"text\" placeholder=\"{{placeholder}}\" aria-describedby=\"fg-tw-help-1\"{{#if required}} required{{/if}}\n 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:{{accent}};\">\n <p id=\"fg-tw-help-1\" class=\"mt-1.5 text-xs text-[#24143099]\">{{helper}}</p>\n</div>", "react": "export function FormGroup({\n label = \"{{label}}\",\n helper = \"{{helper}}\",\n placeholder = \"{{placeholder}}\",\n accent = \"{{accent}}\",\n required = {{required}},\n}) {\n return (\n <div style={{ fontFamily: \"system-ui, sans-serif\", fontSize: 14, color: \"#241430\", maxWidth: 280 }}>\n <label htmlFor=\"fg-react-1\" style={{ display: \"block\", marginBottom: 6, fontWeight: 500 }}>{label}{required && \" *\"}</label>\n <input id=\"fg-react-1\" type=\"text\" placeholder={placeholder} required={required} aria-describedby=\"fg-react-help-1\" style={{\n width: \"100%\", boxSizing: \"border-box\", padding: \"10px 12px\", font: \"inherit\", color: \"#241430\",\n background: \"#FAF7F2\", border: `1.5px solid ${accent}`, borderRadius: 8,\n }} />\n <p id=\"fg-react-help-1\" style={{ margin: \"6px 0 0\", fontSize: 12, color: \"#24143099\" }}>{helper}</p>\n </div>\n );\n}" }
Save
History