Date Input

Date entry control.

html

<label class="di" for="di-1">
  <span class="di__label">Start date</span>
  <input class="di__input" id="di-1" type="date" min="2026-01-01" max="2026-12-31" style="--accent:#BFD9F2;" autocomplete="off">
</label>
<style>
.di { display: block; font: 14px system-ui, sans-serif; color: #241430; max-width: 220px; }
.di__label { display: block; margin-bottom: 6px; font-weight: 500; }
.di__req { color: #241430; }
.di__input { width: 100%; box-sizing: border-box; padding: 10px 12px; font: inherit; color: #241430; background: #FAF7F2; border: 1.5px solid #24143040; border-radius: 8px; }
.di__input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
</style>

tailwind

<label class="block max-w-[220px] font-sans text-sm text-[#241430]" for="di-tw-1">
  <span class="block mb-1.5 font-medium">Start date</span>
  <input id="di-tw-1" type="date" min="2026-01-01" max="2026-12-31" autocomplete="off"
    class="di-tw 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:#BFD9F2;">
</label>
<style>
.di-tw:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, #24143040 35%, transparent); }
</style>

react

export function DateInput({
  label = "Start date",
  min = "2026-01-01",
  max = "2026-12-31",
  accent = "#BFD9F2",
  required = false,
}) {
  return (
    <label style={{ display: "block", maxWidth: 220, fontFamily: "system-ui, sans-serif", fontSize: 14, color: "#241430" }}>
      <span style={{ display: "block", marginBottom: 6, fontWeight: 500 }}>{label}{required && " *"}</span>
      <input type="date" min={min} max={max} required={required} autoComplete="off" style={{
        width: "100%", boxSizing: "border-box", padding: "10px 12px", font: "inherit", color: "#241430",
        background: "#FAF7F2", border: `1.5px solid ${accent}`, borderRadius: 8,
      }} />
    </label>
  );
}