Dev Helpers
← Back

Date input with ISO default

Import and render <DateInputWithISODefault /> in a React project.

Open this example in the interactive library

Live preview

Source code

// components/DateInputWithISODefault.tsx

export default function DateInputWithISODefault({
  iso = "2027-03-14T15:30:00Z",
}: { iso?: string } = {}) {
  return (
    <label>
      Event date <input type="date" defaultValue={iso.slice(0, 10)} />
    </label>
  );
}