Skip to content
← Readonly
Edit Readonly
Name
Also known as (comma separated)
Brief definition
Visible but not editable.
Notes
Tier
Core
Useful
Reference
Deleted
Controls schema (JSON array)
[ { "id": "label", "type": "text", "label": "Field label", "default": "Account ID" }, { "id": "value", "type": "text", "label": "Value", "default": "acct_8f3k2n" }, { "id": "accent", "type": "color", "label": "Accent", "default": "#D9C8F0", "presets": [ "#D9C8F0", "#A8E6C1", "#F5C2E0", "#BFD9F2", "#E8A020", "#241430" ] }, { "id": "force", "type": "toggle", "label": "Read only (real attribute)", "default": true } ]
Templates (JSON object keyed by format)
{ "html": "<label class=\"ro\" style=\"--accent:{{accent}};\">\n <span class=\"ro__label\">{{label}}</span>\n <input class=\"ro__input\" type=\"text\" value=\"{{value}}\"{{#if force}} readonly{{/if}}>\n <span class=\"ro__hint\">Real <code>readonly</code> — visible and focusable, but not editable. <code>:read-only</code> supplies the look.</span>\n</label>\n<style>\n.ro { display: block; width: 280px; box-sizing: border-box; font: 14px/1.5 system-ui, sans-serif; color: #241430; background: #FAF7F2; padding: 16px 18px; border-radius: 12px; }\n.ro__label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 600; color: #241430aa; }\n.ro__input { width: 100%; box-sizing: border-box; font: 14px system-ui, sans-serif; padding: 9px 11px; border-radius: 8px; border: 1.5px solid #24143030; }\n.ro__input:read-only { background: color-mix(in srgb, var(--accent) 16%, #FAF7F2); border-style: dashed; color: #241430aa; cursor: default; }\n.ro__hint { display: block; margin-top: 7px; font-size: 11px; color: #241430888; }\n.ro__hint code { background: #24143012; padding: 1px 5px; border-radius: 4px; }\n</style>", "tailwind": "<label class=\"block w-[280px] box-border font-sans text-sm text-[#241430] bg-[#FAF7F2] px-[18px] py-4 rounded-xl\">\n <span class=\"block mb-1.5 text-xs font-semibold text-[#241430]/65\">{{label}}</span>\n <input type=\"text\" value=\"{{value}}\" class=\"w-full box-border text-sm px-2.5 py-2 rounded-lg border-[1.5px] border-[#24143030] read-only:border-dashed read-only:text-[#241430]/65\"{{#if force}} readonly{{/if}}>\n <span class=\"block mt-1.5 text-[11px] text-[#241430]/55\">Real <code class=\"bg-[#24143012] px-1.5 py-0.5 rounded\">readonly</code> — visible and focusable, but not editable. <code class=\"bg-[#24143012] px-1.5 py-0.5 rounded\">:read-only</code> supplies the look.</span>\n</label>\n<style>\ninput:read-only { background: color-mix(in srgb, {{accent}} 16%, #FAF7F2); }\n</style>", "react": "export function ReadonlyState({\n label = \"{{label}}\",\n value = \"{{value}}\",\n accent = \"{{accent}}\",\n force = {{force}},\n}) {\n return (\n <label style={{ display: \"block\", width: 280, boxSizing: \"border-box\", font: \"14px/1.5 system-ui, sans-serif\", color: \"#241430\", background: \"#FAF7F2\", padding: \"16px 18px\", borderRadius: 12 }}>\n <span style={{ display: \"block\", marginBottom: 7, fontSize: 12, fontWeight: 600, color: \"#241430aa\" }}>{label}</span>\n <input type=\"text\" defaultValue={value} readOnly={force}\n style={{ width: \"100%\", boxSizing: \"border-box\", font: \"14px system-ui, sans-serif\", padding: \"9px 11px\", borderRadius: 8, border: force ? \"1.5px dashed #24143030\" : \"1.5px solid #24143030\", background: force ? `color-mix(in srgb, ${accent} 16%, #FAF7F2)` : \"transparent\", color: force ? \"#241430aa\" : \"#241430\", cursor: force ? \"default\" : \"text\" }} />\n <span style={{ display: \"block\", marginTop: 7, fontSize: 11, color: \"#241430888\" }}>Real <code>readOnly</code> — visible and focusable, but not editable.</span>\n </label>\n );\n}" }
Save
History