Single-line text control.
<label class="field">
<span class="field__label">Email address</span>
<input class="field__input field__input--outline" style="--accent:#BFD9F2;border-radius:8px;" type="text" placeholder="you@example.com">
</label>
<style>
.field { display: block; font: 14px system-ui, sans-serif; color: #241430; max-width: 280px; }
.field__label { display: block; margin-bottom: 6px; font-weight: 500; }
.field__req { color: #241430; }
.field__input { width: 100%; box-sizing: border-box; padding: 10px 12px; font: inherit; color: #241430; background: #FAF7F2; }
.field__input--outline { border: 1.5px solid #24143040; }
.field__input--filled { border: 1.5px solid transparent; background: #24143010; }
.field__input--underline { border: none; border-bottom: 1.5px solid #24143040; border-radius: 0 !important; }
.field__input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
</style><label class="block max-w-xs text-sm text-[#241430] font-sans">
<span class="block mb-1.5 font-medium">Email address</span>
<input type="text" placeholder="you@example.com"
class="field-tw field-tw--outline w-full box-border px-3 py-2.5 bg-[#FAF7F2] border-[1.5px] focus-visible:outline-none"
style="border-radius:8px;border-color:#BFD9F2;">
</label>
<style>
.field-tw--filled { background: #24143010 !important; border-color: transparent !important; }
.field-tw--underline { border: none !important; border-bottom: 1.5px solid #BFD9F2 !important; border-radius: 0 !important; }
</style>export function TextInput({
label = "Email address",
placeholder = "you@example.com",
variant = "outline",
accent = "#BFD9F2",
radius = 8,
required = false,
}) {
const border = { outline: "1.5px solid #24143040", filled: "1.5px solid transparent",
underline: "none" }[variant] ?? "1.5px solid #24143040";
return (
<label style={{ display: "block", maxWidth: 280, fontFamily: "system-ui, sans-serif", fontSize: 14, color: "#241430" }}>
<span style={{ display: "block", marginBottom: 6, fontWeight: 500 }}>
{label}{required && " *"}
</span>
<input type="text" placeholder={placeholder} required={required} style={{
width: "100%", boxSizing: "border-box", padding: "10px 12px", font: "inherit",
color: "#241430", background: variant === "filled" ? "#24143010" : "#FAF7F2",
border, borderRadius: variant === "underline" ? 0 : radius,
borderBottom: variant === "underline" ? `1.5px solid ${accent}` : undefined,
}} />
</label>
);
}