Placeholder

Example text shown before input.

html

<label class="ph ph--normal" for="ph-1">
  <span class="ph__label">Search</span>
  <input class="ph__input" id="ph-1" type="text" placeholder="Search products..." style="--accent:#BFD9F2;border-radius:8px;">
</label>
<style>
.ph { display: block; font: 14px system-ui, sans-serif; color: #241430; max-width: 260px; }
.ph__label { display: block; margin-bottom: 6px; font-weight: 500; }
.ph__input { width: 100%; box-sizing: border-box; padding: 10px 12px; font: inherit; color: #241430; background: #FAF7F2; border: 1.5px solid #24143040; }
.ph__input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.ph--italic .ph__input::placeholder { font-style: italic; color: #24143080; }
.ph--normal .ph__input::placeholder { font-style: normal; color: #24143080; }
</style>

tailwind

<label class="ph-tw ph-tw--normal block max-w-[260px] font-sans text-sm text-[#241430]" for="ph-tw-1">
  <span class="block mb-1.5 font-medium">Search</span>
  <input id="ph-tw-1" type="text" placeholder="Search products..." class="w-full box-border px-3 py-2.5 bg-[#FAF7F2] border-[1.5px] border-[#24143040] focus-visible:outline-none" style="border-radius:8px;border-color:#BFD9F2;">
</label>
<style>
.ph-tw--italic input::placeholder { font-style: italic; color: #24143080; }
.ph-tw--normal input::placeholder { font-style: normal; color: #24143080; }
</style>

react

export function Placeholder({
  label = "Search",
  placeholder = "Search products...",
  italic = false,
  accent = "#BFD9F2",
  radius = 8,
}) {
  return (
    <label style={{ display: "block", maxWidth: 260, fontFamily: "system-ui, sans-serif", fontSize: 14, color: "#241430" }}>
      <span style={{ display: "block", marginBottom: 6, fontWeight: 500 }}>{label}</span>
      <input type="text" placeholder={placeholder} className={italic ? "ph-react-italic" : "ph-react-normal"} style={{
        width: "100%", boxSizing: "border-box", padding: "10px 12px", font: "inherit", color: "#241430",
        background: "#FAF7F2", border: `1.5px solid ${accent}`, borderRadius: radius,
      }} />
      <style>{`
        .ph-react-italic::placeholder { font-style: italic; color: #24143080; }
        .ph-react-normal::placeholder { font-style: normal; color: #24143080; }
      `}</style>
    </label>
  );
}