Readonly

Visible but not editable.

html

<label class="ro" style="--accent:#D9C8F0;">
  <span class="ro__label">Account ID</span>
  <input class="ro__input" type="text" value="acct_8f3k2n" readonly>
  <span class="ro__hint">Real <code>readonly</code> — visible and focusable, but not editable. <code>:read-only</code> supplies the look.</span>
</label>
<style>
.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; }
.ro__label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 600; color: #241430aa; }
.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; }
.ro__input:read-only { background: color-mix(in srgb, var(--accent) 16%, #FAF7F2); border-style: dashed; color: #241430aa; cursor: default; }
.ro__hint { display: block; margin-top: 7px; font-size: 11px; color: #241430888; }
.ro__hint code { background: #24143012; padding: 1px 5px; border-radius: 4px; }
</style>

tailwind

<label class="block w-[280px] box-border font-sans text-sm text-[#241430] bg-[#FAF7F2] px-[18px] py-4 rounded-xl">
  <span class="block mb-1.5 text-xs font-semibold text-[#241430]/65">Account ID</span>
  <input type="text" value="acct_8f3k2n" 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" readonly>
  <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>
</label>
<style>
input:read-only { background: color-mix(in srgb, #D9C8F0 16%, #FAF7F2); }
</style>

react

export function ReadonlyState({
  label = "Account ID",
  value = "acct_8f3k2n",
  accent = "#D9C8F0",
  force = true,
}) {
  return (
    <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 }}>
      <span style={{ display: "block", marginBottom: 7, fontSize: 12, fontWeight: 600, color: "#241430aa" }}>{label}</span>
      <input type="text" defaultValue={value} readOnly={force}
        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" }} />
      <span style={{ display: "block", marginTop: 7, fontSize: 11, color: "#241430888" }}>Real <code>readOnly</code> — visible and focusable, but not editable.</span>
    </label>
  );
}