Booking Slot Selector
Available booking slots highlight on hover and can be selected with radio buttons.
Available booking slots highlight on hover and can be selected with radio buttons.
Live Demo
Hover over the element or use Tab to focus.
Source Code
Copy the HTML, CSS or JavaScript you need for your project.
<fieldset class="tbx-1054"><legend>Preferred time slot</legend><div class="tbx-1054__grid">
<label><input type="radio" name="tbx-1054-time" value="10:00"><span>10:00</span></label>
<label><input type="radio" name="tbx-1054-time" value="11:30"><span>11:30</span></label>
<label><input type="radio" name="tbx-1054-time" value="13:00" disabled><span>13:00<small>Fully booked</small></span></label>
<label><input type="radio" name="tbx-1054-time" value="15:00"><span>15:00</span></label>
<label><input type="radio" name="tbx-1054-time" value="16:30"><span>16:30</span></label>
<label><input type="radio" name="tbx-1054-time" value="18:00"><span>18:00</span></label>
</div><p>Sample availability for demonstration only</p></fieldset>
.tbx-1054{width:min(280px,100%);border:0;padding:0;margin:0;color:#2a485a;font-family:system-ui}.tbx-1054 legend{font-size:12px;font-weight:750;margin-bottom:12px}.tbx-1054__grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.tbx-1054 label{position:relative;cursor:pointer}.tbx-1054 input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;cursor:pointer}
.tbx-1054 label span{min-height:46px;display:flex;justify-content:center;align-items:center;flex-direction:column;gap:1px;border:1px solid #d4e2e8;background:white;border-radius:7px;font-size:12px;font-weight:700;transition:color .2s,background .2s,transform .2s,border-color .2s}.tbx-1054 small{font-size:8px;font-weight:550}.tbx-1054 label:has(input:not(:disabled)):is(:hover,:focus-within) span{border-color:#38868a;transform:translateY(-2px);background:#e6f5f3}.tbx-1054 input:checked+span{background:#215f69;color:white;border-color:#215f69}.tbx-1054 input:disabled+span{color:#9aa7b4;background:#f0f3f6;text-decoration:line-through;cursor:not-allowed}.tbx-1054 input:focus-visible+span{outline:3px solid #d5a06b;outline-offset:2px}.tbx-1054 p{margin:10px 0 0;color:#8696a3;font-size:9px}
@media(prefers-reduced-motion:reduce){.tbx-1054 label span{transition:none}}
How to Use
Insert the HTML and add the CSS to your stylesheet. Adjust colors and sizes and avoid class conflicts.
Use Case
Useful for reservation sections and forms.
Technical Notes
Keep controls usable on touch devices. Test keyboard focus and reduced-motion preferences.
Mobile: Ensure the interactive content remains accessible without hover on touch devices.
Browser: Uses modern CSS. Check behavior in the browsers you support.
Reduced Motion: Check that prefers-reduced-motion is respected.