Accessible date picker in HTML and CSS
A date-picking calendar fully usable with the keyboard, with closed days, a minimum lead time and checked manual entry.
Here is an excerpt of this component's code in HTML and CSS. The full code is free for members, ready to copy into your project.
This component also comes in
The code in HTML and CSS
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Sélecteur de date accessible</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<main class="demo">
<form class="sdc" data-sdc data-sdc-closed="0,1" data-sdc-lead="2" data-sdc-day-class="sdc-day" novalidate aria-labelledby="sdc-titre">
<h2 class="sdc-title" id="sdc-titre">Commander un gâteau</h2>document.querySelectorAll("[data-sdc]").forEach((root) => {
const on = (el, type, fn) => el.addEventListener(type, fn);
const form = root;
const input = form.querySelector("#sdc-date");
const toggle = form.querySelector("[data-sdc-toggle]");
const pop = form.querySelector("[data-sdc-pop]");
const days = form.querySelector("[data-sdc-days]");
const help = form.querySelector("[data-sdc-help]");
const status = form.querySelector("[data-sdc-status]");
const closed = (form.dataset.sdcClosed ?? "").split(",").filter(Boolean).map(Number);
const dayClass = form.dataset.sdcDayClass ?? "";
const addDays = (date, n) => new Date(date.getFullYear(), date.getMonth(), date.getDate() + n);:root {
--sdc-card: #ffffff;
--sdc-text: #1d2433;
--sdc-muted: #4b5263;
--sdc-off: #8a8f9c;
--sdc-line: #cdd1db;
--sdc-field: #ffffff;
--sdc-hover: #f1ecfb;
--sdc-accent: #5b21b6;
--sdc-accent-text: #ffffff;
--sdc-error: #b91c1c;
--demo-bg: #eeecf4;Free component: copy it freely, including for commercial projects.
Other forms and inputs components in HTML and CSS
Forms and inputs components in HTML and CSS
A quote request form for tradespeople: the customer describes the work, picks a start date range and attaches up to six site photos, each with a preview, its size and a button to remove it.
- Tailwind
- React
- CSS
- WordPress

A quote request form whose labels, hints and error messages are full French sentences, still readable at 320 px: nothing overflows, nothing is cut off, and each error is tied to its field.
- Tailwind
- React
- CSS
- WordPress

Visitors pick a package and tick options: the pre-tax total, VAT and total including tax update live, and the summary is sent with the contact form.
- Tailwind
- React
- CSS
- WordPress

A short NPS survey: a 0 to 10 score as radio buttons, then a follow-up question adapted to whether the customer is a detractor, passive or promoter.
- Tailwind
- React
- CSS
- WordPress

An honest unsubscribe page: address prefilled from the link, choice between stopping everything or receiving less, optional reason and an undo.
- Tailwind
- React
- CSS
- WordPress

A callback request form: French phone number checked and formatted, topic, working day and time slot, with explicit consent to the call.
- Tailwind
- React
- CSS
- WordPress